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

faas-cli new --help shows a --name flag #151

Closed
rgee0 opened this issue Oct 8, 2017 · 5 comments
Closed

faas-cli new --help shows a --name flag #151

rgee0 opened this issue Oct 8, 2017 · 5 comments
Labels

Comments

@rgee0
Copy link
Contributor

rgee0 commented Oct 8, 2017

Expected Behaviour

The help text should be unambiguous and help the user navigate the CLI options effectively.

Current Behaviour

Running $ faas-cli new --help yields the following:

The new command creates a new function based upon hello-world in the given
language or type in --list for a list of languages available.

Usage:
  faas-cli new FUNCTION_NAME --lang=FUNCTION_LANGUAGE [--gateway=http://domain:port] | --list) [flags]

Examples:
faas-cli new chatbot --lang node
  faas-cli new textparser --lang python --gateway http://mydomain:8080
  faas-cli new --list

Flags:
      --gateway string   Gateway URL to store in YAML stack file (default "http://localhost:8080")
  -h, --help             help for new
      --lang string      Language or template to use
      --list             List available languages
      --name string      Name for your function

Global Flags:
      --filter string   Wildcard to match with function names in YAML file
      --regex string    Regex to match with function names in YAML file
  -f, --yaml string     Path to YAML file describing function(s)

The usage line appears to be accurate but there is a --name shown in the flags which may lead users to attempt the following command:

$ faas-cli new --name thisisthename --lang ruby
Please provide a name for the function

Possible Solution

Remove --name from the help text or ensure use of --name overrides the args length check.

Steps to Reproduce (for bugs)

1.Run $ faas-cli new --name thisisthename --lang ruby
2.
3.
4.

Context

This has potential to mislead the user and is contrary to the aims of the help text.

Your Environment

  • Docker version docker version (e.g. Docker 17.0.05 ):
Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:09 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:45:38 2017
 OS/Arch:      linux/amd64
 Experimental: true
  • Are you using Docker Swarm or Kubernetes (FaaS-netes)?
    Docker Swarm

  • Operating System and version (e.g. Linux, Windows, MacOS):
    MacOS

  • Link to your project or a code example to reproduce issue:

@johnmccabe
Copy link
Contributor

johnmccabe commented Oct 8, 2017

@rgee0 @alexellis @gardlt did anyone check that the cli backwards compatibility was being maintained when this verb change was made? In the legacy_cli.go.

Or @alexellis have you decided we should sever backwards compatibility (we should do so at some point) - impact being to blog posts/docs referring to old flags.

@rgee0
Copy link
Contributor Author

rgee0 commented Oct 8, 2017

@johnmccabe the excellent legacy_cli_test.go still passes. I think maybe new didn't exist in the legacy cli?

@johnmccabe
Copy link
Contributor

Ahh ignore me so, you're correct, its fine.

@johnmccabe
Copy link
Contributor

Derek add label: bug

@open-derek open-derek bot added the bug label Oct 8, 2017
@alexellis
Copy link
Member

Fixed in commit f13001a. Will be out in next release.

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

No branches or pull requests

3 participants