MCPcopy
hub / github.com/restic/restic / newCacheCommand

Function newCacheCommand

cmd/restic/cmd_cache.go:20–44  ·  view source on GitHub ↗
(globalOptions *global.Options)

Source from the content-addressed store, hash-verified

18)
19
20func newCacheCommand(globalOptions *global.Options) *cobra.Command {
21 var opts CacheOptions
22
23 cmd := &cobra.Command{
24 Use: "cache",
25 Short: "Operate on local cache directories",
26 Long: `
27The "cache" command allows listing and cleaning local cache directories.
28
29EXIT STATUS
30===========
31
32Exit status is 0 if the command was successful.
33Exit status is 1 if there was any error.
34`,
35 GroupID: cmdGroupDefault,
36 DisableAutoGenTag: true,
37 RunE: func(_ *cobra.Command, args []string) error {
38 return runCache(opts, *globalOptions, args, globalOptions.Term)
39 },
40 }
41
42 opts.AddFlags(cmd.Flags())
43 return cmd
44}
45
46// CacheOptions bundles all options for the snapshots command.
47type CacheOptions struct {

Callers 1

newRootCommandFunction · 0.85

Calls 2

AddFlagsMethod · 0.95
runCacheFunction · 0.85

Tested by

no test coverage detected