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

Add support for flag groups #106

Closed
leodido opened this issue Feb 22, 2023 · 0 comments · Fixed by #105
Closed

Add support for flag groups #106

leodido opened this issue Feb 22, 2023 · 0 comments · Fixed by #105
Labels
enhancement New feature or request

Comments

@leodido
Copy link
Member

leodido commented Feb 22, 2023

Describe the feature or problem you’d like to solve

We wanna a way to show flag usages grouped into different categories.

Proposed solution

The users will benefit from this feature by having a well-organized set of help messages and manuals.

At the moment we have this help message for the root command:

❯ ./lstn help
Analyze the behavior of your dependencies using listen.dev

Usage:
  lstn [command]

Core Commands:
  in          Inspect the verdicts of your dependencies
  to          Get the verdicts of a package

Additional Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Print out version information

Flags:
      --config string     config file (default is $HOME/.lstn.yaml)
      --endpoint string   the listen.dev endpoint emitting the verdicts (default "https://npm.listen.dev")
      --loglevel string   log level (default "info")
      --timeout int       timeout in seconds (default 60)

Additional help topics:
  lstn config      Details about the ~/.lstn.yaml config file
  lstn environment Which environment variables you can use with lstn
  lstn exit        Details about the lstn exit codes
  lstn manual      A comprehensive reference of all the lstn commands

Use "lstn [command] --help" for more information about a command.

We wanna something more organized, like the following one:

❯ ./lstn help
Analyze the behavior of your dependencies using listen.dev

Usage:
  lstn [command]

Core Commands:
  in          Inspect the verdicts of your dependencies
  to          Get the verdicts of a package

Additional Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Print out version information

Flags:
      --config string     config file (default is $HOME/.lstn.yaml)

Config Flags:
      --endpoint string   the listen.dev endpoint emitting the verdicts (default "https://npm.listen.dev")
  -h, --help              help for lstn
      --loglevel string   log level (default "info")
      --timeout int       timeout in seconds (default 60)

Additional help topics:
  lstn config      Details about the ~/.lstn.yaml config file
  lstn environment Which environment variables you can use with lstn
  lstn exit        Details about the lstn exit codes
  lstn manual      A comprehensive reference of all the lstn commands

Use "lstn [command] --help" for more information about a command.

Of course, this feature must apply to all the child commands too.

Additional context

This feature is not currently supported by Cobra (see spf13/cobra#1327)

@leodido leodido added the enhancement New feature or request label Feb 22, 2023
@leodido leodido mentioned this issue Feb 22, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant