1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #24592 from thaJeztah/remove-dead-code

Remove dead code for "inspect --pretty"
This commit is contained in:
Tibor Vass 2016-07-13 14:46:42 -07:00 committed by GitHub
commit 1c6a8715ab

View file

@ -11,7 +11,6 @@ import (
type inspectOptions struct { type inspectOptions struct {
format string format string
// pretty bool
} }
func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command { func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
@ -22,16 +21,12 @@ func newInspectCommand(dockerCli *client.DockerCli) *cobra.Command {
Short: "Inspect the Swarm", Short: "Inspect the Swarm",
Args: cli.NoArgs, Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
// if opts.pretty && len(opts.format) > 0 {
// return fmt.Errorf("--format is incompatible with human friendly format")
// }
return runInspect(dockerCli, opts) return runInspect(dockerCli, opts)
}, },
} }
flags := cmd.Flags() flags := cmd.Flags()
flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given go template") flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given go template")
//flags.BoolVarP(&opts.pretty, "pretty", "h", false, "Print the information in a human friendly format.")
return cmd return cmd
} }
@ -48,9 +43,5 @@ func runInspect(dockerCli *client.DockerCli, opts inspectOptions) error {
return swarm, nil, nil return swarm, nil, nil
} }
// if !opts.pretty {
return inspect.Inspect(dockerCli.Out(), []string{""}, opts.format, getRef) return inspect.Inspect(dockerCli.Out(), []string{""}, opts.format, getRef)
// }
//return printHumanFriendly(dockerCli.Out(), opts.refs, getRef)
} }