Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Pass the first arg directly
Browse files Browse the repository at this point in the history
Cobra makes sure that it's thee

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
  • Loading branch information
rumpl committed Oct 17, 2019
1 parent 12fa9c0 commit 736983d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions internal/commands/image/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ type inspectOptions struct {
pretty bool
}

func firstOrEmpty(list []string) string {
if len(list) != 0 {
return list[0]
}
return ""
}

func muteDockerCli(dockerCli command.Cli) func() {
stdout := dockerCli.Out()
stderr := dockerCli.Err()
Expand All @@ -43,7 +36,7 @@ func inspectCmd(dockerCli command.Cli) *cobra.Command {
$docker app inspect my-app:1.0.0`,
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runInspect(dockerCli, firstOrEmpty(args), opts)
return runInspect(dockerCli, args[0], opts)
},
}
cmd.Flags().BoolVar(&opts.pretty, "pretty", false, "Pretty print the output")
Expand Down

0 comments on commit 736983d

Please sign in to comment.