mirror of https://github.com/docker/cli.git
cli-plugins: helloworld: rename var that collided with import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c825db8a69
commit
c0a0b05dc8
|
@ -45,8 +45,8 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
who, context string
|
who, optContext string
|
||||||
preRun, debug bool
|
preRun, debug bool
|
||||||
)
|
)
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "helloworld",
|
Use: "helloworld",
|
||||||
|
@ -65,7 +65,7 @@ func main() {
|
||||||
fmt.Fprintf(dockerCli.Err(), "Plugin debug mode enabled")
|
fmt.Fprintf(dockerCli.Err(), "Plugin debug mode enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
switch context {
|
switch optContext {
|
||||||
case "Christmas":
|
case "Christmas":
|
||||||
fmt.Fprintf(dockerCli.Out(), "Merry Christmas!\n")
|
fmt.Fprintf(dockerCli.Out(), "Merry Christmas!\n")
|
||||||
return nil
|
return nil
|
||||||
|
@ -92,7 +92,7 @@ func main() {
|
||||||
// These are intended to deliberately clash with the CLIs own top
|
// These are intended to deliberately clash with the CLIs own top
|
||||||
// level arguments.
|
// level arguments.
|
||||||
flags.BoolVarP(&debug, "debug", "D", false, "Enable debug")
|
flags.BoolVarP(&debug, "debug", "D", false, "Enable debug")
|
||||||
flags.StringVarP(&context, "context", "c", "", "Is it Christmas?")
|
flags.StringVarP(&optContext, "context", "c", "", "Is it Christmas?")
|
||||||
|
|
||||||
cmd.AddCommand(goodbye, apiversion, exitStatus2)
|
cmd.AddCommand(goodbye, apiversion, exitStatus2)
|
||||||
return cmd
|
return cmd
|
||||||
|
|
Loading…
Reference in New Issue