()
| 19 | const listUsageLongHelp = `List images and digests.` |
| 20 | |
| 21 | func newListCommand() *cobra.Command { |
| 22 | |
| 23 | list := &listCommand{ |
| 24 | filters: newListValue(), |
| 25 | } |
| 26 | |
| 27 | cmd := &cobra.Command{ |
| 28 | Use: "ls [OPTIONS]", |
| 29 | DisableFlagsInUseLine: true, |
| 30 | SilenceUsage: true, |
| 31 | Short: listUsageShortHelp, |
| 32 | Long: listUsageLongHelp, |
| 33 | Args: validateHasNoArgs, |
| 34 | RunE: func(cmd *cobra.Command, args []string) error { |
| 35 | return list.Run(args) |
| 36 | }, |
| 37 | } |
| 38 | |
| 39 | fs := cmd.Flags() |
| 40 | |
| 41 | fs.VarP(list.filters, "filter", "f", "Filter output based on conditions provided") |
| 42 | |
| 43 | return cmd |
| 44 | } |
| 45 | |
| 46 | type listCommand struct { |
| 47 | filters *listValue |
no test coverage detected
searching dependent graphs…