Skip to content

Support subcommands in Homebrew::CLI::Parser #19639

@MikeMcQuaid

Description

@MikeMcQuaid

Verification

Provide a detailed description of the proposed feature

We have brew bundle and brew services commands that both provide "subcommands" i.e. brew bundle install, brew bundle exec, etc.

These both have some fairly messy and repetitive argument handling, don't do decent generation of e.g. manpages/completions/etc. and don't handle switches well e.g. those that only apply to one subcommand and not others.

#19638 is an example of a slightly messy workaround for brew services that doesn't get e.g. brew services info <tab> to work nicely.

What is the motivation for the feature?

  • Improved user experience using subcommands
  • Improved APIs for developers creating subcommands

How will the feature be relevant to at least 90% of Homebrew users?

Improved user experience using subcommands

What alternatives to the feature have been considered?

Migrating all subcommands to e.g. brew bundle-exec instead of brew bundle exec. This would require some workflow changes for users but would result in less code being needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe want help addressing this

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions