mirror of https://github.com/docker/cli.git
update cobra and use Tags
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
eb522dac24
commit
1e10649f55
|
@ -17,6 +17,7 @@ func NewCheckpointCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
||||||
},
|
},
|
||||||
|
Tags: map[string]string{"experimental": ""},
|
||||||
}
|
}
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
newCreateCommand(dockerCli),
|
newCreateCommand(dockerCli),
|
||||||
|
|
|
@ -38,21 +38,15 @@ type DockerCli struct {
|
||||||
err io.Writer
|
err io.Writer
|
||||||
keyFile string
|
keyFile string
|
||||||
client client.APIClient
|
client client.APIClient
|
||||||
hasExperimental *bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasExperimental returns true if experimental features are accessible
|
// HasExperimental returns true if experimental features are accessible
|
||||||
func (cli *DockerCli) HasExperimental() bool {
|
func (cli *DockerCli) HasExperimental() bool {
|
||||||
if cli.hasExperimental == nil {
|
|
||||||
if cli.client == nil {
|
if cli.client == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
enabled := false
|
enabled, _ := cli.client.Ping(context.Background())
|
||||||
cli.hasExperimental = &enabled
|
return enabled
|
||||||
enabled, _ = cli.client.Ping(context.Background())
|
|
||||||
}
|
|
||||||
|
|
||||||
return *cli.hasExperimental
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client returns the APIClient
|
// Client returns the APIClient
|
||||||
|
|
|
@ -46,8 +46,8 @@ func NewStartCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container")
|
flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container")
|
||||||
|
|
||||||
flags.StringVar(&opts.checkpoint, "checkpoint", "", "Restore from this checkpoint")
|
flags.StringVar(&opts.checkpoint, "checkpoint", "", "Restore from this checkpoint")
|
||||||
flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory")
|
|
||||||
flags.SetAnnotation("checkpoint", "experimental", nil)
|
flags.SetAnnotation("checkpoint", "experimental", nil)
|
||||||
|
flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory")
|
||||||
flags.SetAnnotation("checkpoint-dir", "experimental", nil)
|
flags.SetAnnotation("checkpoint-dir", "experimental", nil)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ func NewPluginCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
||||||
},
|
},
|
||||||
|
Tags: map[string]string{"experimental": ""},
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
|
|
|
@ -17,6 +17,7 @@ func NewStackCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
||||||
},
|
},
|
||||||
|
Tags: map[string]string{"experimental": ""},
|
||||||
}
|
}
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
newConfigCommand(dockerCli),
|
newConfigCommand(dockerCli),
|
||||||
|
|
|
@ -36,6 +36,7 @@ func newDeployCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
opts.namespace = strings.TrimSuffix(args[0], ".dab")
|
opts.namespace = strings.TrimSuffix(args[0], ".dab")
|
||||||
return runDeploy(dockerCli, opts)
|
return runDeploy(dockerCli, opts)
|
||||||
},
|
},
|
||||||
|
Tags: map[string]string{"experimental": ""},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags := cmd.Flags()
|
flags := cmd.Flags()
|
||||||
|
|
Loading…
Reference in New Issue