Skip to content

Ability to group commands in the help #607

@joffrey-bion

Description

@joffrey-bion

Just like we have OptionGroup to group options in the help, it would be nice to have a way to group subcommands.

In our Amper build tool, the help looks like this:

Usage: amper [<options>] <command> [<args>]...

Options:
  -v, --version                            Show the version and exit
  --root=<path>                            Amper project root
  --log-level=(debug|info|warn|error|off)  Console logging level (default: INFO)
  --shared-caches-root=<path>              Path to the cache directory shared between all Amper projects (default: C:\Users\Joffrey.Bion\AppData\Local\JetBrains\Amper)
  --async-profiler                         Profile Amper with Async Profiler
  --build-output=<path>                    Root directory for build outputs. By default, this is the build directory under the project root.
  -h, --help                               Show this message and exit

Commands:
  build                Compile and link all code in the project
  clean                Remove the project's build output and caches
  clean-shared-caches  Remove the Amper caches that are shared between projects
  generate-completion  Generate a tab-completion script for the Amper command for the given shell (bash, zsh, or fish)
  init                 Initialize a new Amper project based on a template
  package              Package the project artifacts for distribution
  publish              Publish modules to a repository
  run                  Run your application
  show                 Show information about some aspect the project (modules, tasks, effective settings...). See help for details.
  task                 Run a task and its dependencies from the task graph
  test                 Run tests in the project
  tool                 Run a tool
  update               Update Amper to the latest version

A subset of these commands are "global" commands (don't need a project), while others are project-level commands and need to be run in a project directory to work.
It would be nice to show them in 2 groups to make the distinction clearer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions