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

output for fastly subcommand help and fastly subcommand --help don't match #950

Open
cratelyn opened this issue Jun 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@cratelyn
Copy link
Contributor

Version

; fastly version
Fastly CLI version v10.2.0 (a61eac5c)
Built with go version go1.20.4 linux/amd64

What happened

i was setting up a new service, and noticed that certain command-line flags are not shown, depending on how you ask the Fastly CLI for help:

; fastly service create --help 
USAGE
  fastly service create [<flags>]

Create a Fastly service

OPTIONAL FLAGS
      --comment=COMMENT  Human-readable comment
  -n, --name=NAME        Service name
      --type=vcl         Service type. Can be one of "wasm" or "vcl", defaults
                         to "vcl".

GLOBAL FLAGS
      --help             Show context-sensitive help.
  -d, --accept-defaults  Accept default options for all interactive prompts
                         apart from Yes/No confirmations
  -y, --auto-yes         Answer yes automatically to all Yes/No confirmations.
                         This may suppress security warnings
  -i, --non-interactive  Do not prompt for user input - suitable for CI
                         processes. Equivalent to --accept-defaults and
                         --auto-yes
  -o, --profile=PROFILE  Switch account profile for single command execution
                         (see also: 'fastly profile switch')
  -q, --quiet            Silence all output except direct command output.
                         This won't prevent interactive prompts (see:
                         --accept-defaults, --auto-yes, --non-interactive)
  -t, --token=TOKEN      Fastly API token (or via FASTLY_API_TOKEN)
  -v, --verbose          Verbose logging

SEE ALSO
  https://developer.fastly.com/reference/cli/service/create/

; fastly help service create
USAGE
  fastly [<flags>] service create [<flags>]

GLOBAL FLAGS
      --help             Show context-sensitive help.
  -d, --accept-defaults  Accept default options for all interactive prompts
                         apart from Yes/No confirmations
  -y, --auto-yes         Answer yes automatically to all Yes/No confirmations.
                         This may suppress security warnings
  -i, --non-interactive  Do not prompt for user input - suitable for CI
                         processes. Equivalent to --accept-defaults and
                         --auto-yes
  -o, --profile=PROFILE  Switch account profile for single command execution
                         (see also: 'fastly profile switch')
  -q, --quiet            Silence all output except direct command output.
                         This won't prevent interactive prompts (see:
                         --accept-defaults, --auto-yes, --non-interactive)
  -t, --token=TOKEN      Fastly API token (or via FASTLY_API_TOKEN)
  -v, --verbose          Verbose logging

SEE ALSO
  https://developer.fastly.com/reference/cli/service/create/

in my case, --type was the important flag that i was looking for, which only shows up when --help is used.

@cratelyn cratelyn added the bug Something isn't working label Jun 13, 2023
@Integralist
Copy link
Collaborator

👋🏻

Yup. They behave slightly differently and my understanding is that this is a side effect of the CLI parser we're using (Kingpin), which has long been unmaintained.

Ideally, we should migrate to another parser (and that work was started by @grantstephens here #738 but the work wasn't scheduled/prioritised) but there are probably lots of edge cases and integration details we need to account for so not necessarily a simple task as we lean fairly heavily into the Kingpin features and have some custom overrides that might be tricky to migrate.

I'll raise this internally to get feedback and will report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants