(globalOptions *global.Options)
| 18 | ) |
| 19 | |
| 20 | func 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: ` |
| 27 | The "cache" command allows listing and cleaning local cache directories. |
| 28 | |
| 29 | EXIT STATUS |
| 30 | =========== |
| 31 | |
| 32 | Exit status is 0 if the command was successful. |
| 33 | Exit 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. |
| 47 | type CacheOptions struct { |
no test coverage detected