Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The experimental commands are displayed in non experimental environment. #1417

Open
yihyunyi opened this issue Oct 4, 2018 · 2 comments
Open

Comments

@yihyunyi
Copy link

yihyunyi commented Oct 4, 2018

Description

Steps to reproduce the issue:
1.

$ docker
....
Management Commands:
  config      Manage Docker configs
  container   Manage containers
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes
$ docker -H
flag needs an argument: 'H' in -H
See 'docker --help'.
....
Management Commands:
  checkpoint  Manage checkpoints
  config      Manage Docker configs
  container   Manage containers
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Describe the results you received:
When i tried to use some options like '-H' without needed argument,
some experimental commands like 'checkpoint' displayed.

Describe the results you expected:
The experimental commands have to hide in non experimental environments.

It looks unlike in /cli/cmd/docker/docker.go's a function setFlagErrorFunc(), a function setHelpFunc() calls hideUnsupportedFeatures()

func setHelpFunc(dockerCli *command.DockerCli, cmd *cobra.Command, flags *pflag.FlagSet, opts *cliflags.ClientOptions) {
	defaultHelpFunc := cmd.HelpFunc()
	cmd.SetHelpFunc(func(ccmd *cobra.Command, args []string) {
		if err := initializeDockerCli(dockerCli, flags, opts); err != nil {
			ccmd.Println(err)
			return
		}
		if err := isSupported(ccmd, dockerCli); err != nil {
			ccmd.Println(err)
			return
		}

		hideUnsupportedFeatures(ccmd, dockerCli)
		defaultHelpFunc(ccmd, args)
	})
}

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Docker version 17.05.0-ce, build 89658be
Docker version 18.06.1-ce, build e68fc7a

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.):

@thaJeztah
Copy link
Member

Thanks for reporting; are you interested in opening a pull request for this?

@bsousaa
Copy link
Contributor

bsousaa commented Jan 31, 2023

We need some investigation to confirm if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants