MCPcopy Index your code
hub / github.com/docker/cli / newInfoCommand

Function newInfoCommand

cli/command/system/info.go:63–83  ·  view source on GitHub ↗

newInfoCommand creates a new cobra.Command for `docker info`

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

61
62// newInfoCommand creates a new cobra.Command for `docker info`
63func newInfoCommand(dockerCLI command.Cli) *cobra.Command {
64 var opts infoOptions
65
66 cmd := &cobra.Command{
67 Use: "info [OPTIONS]",
68 Short: "Display system-wide information",
69 Args: cli.NoArgs,
70 RunE: func(cmd *cobra.Command, args []string) error {
71 return runInfo(cmd.Context(), cmd, dockerCLI, &opts)
72 },
73 Annotations: map[string]string{
74 "category-top": "12",
75 "aliases": "docker system info, docker info",
76 },
77 ValidArgsFunction: cobra.NoFileCompletions,
78 DisableFlagsInUseLine: true,
79 }
80
81 cmd.Flags().StringVarP(&opts.format, "format", "f", "", flagsHelper.InspectFormatHelp)
82 return cmd
83}
84
85func runInfo(ctx context.Context, cmd *cobra.Command, dockerCli command.Cli, opts *infoOptions) error {
86 info := dockerInfo{

Callers 1

newSystemCommandFunction · 0.85

Calls 1

runInfoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…