MCPcopy
hub / github.com/genuinetools/img / newListCommand

Function newListCommand

list.go:21–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19const listUsageLongHelp = `List images and digests.`
20
21func 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
46type listCommand struct {
47 filters *listValue

Callers 1

mainFunction · 0.85

Calls 2

RunMethod · 0.95
newListValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…