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

Auto-sort commands #206

Open
1 of 2 tasks
peterbe opened this issue Apr 26, 2021 · 1 comment
Open
1 of 2 tasks

Auto-sort commands #206

peterbe opened this issue Apr 26, 2021 · 1 comment

Comments

@peterbe
Copy link

peterbe commented Apr 26, 2021

Is your feature request related to a problem? Please describe.

We keep adding .command("foo").argument("...").action("...") to the bottom of the program.
Would be nice if --help could sort all the commands alphabetically.

Describe the solution you'd like
program.help({sort: 'alphabetically'}) perhaps

Describe alternatives you've considered

Manually re-arrange the blocks of .command("foo").argument("...").action("...").

Additional context
Screen Shot 2021-04-26 at 11 23 30 AM

Would you be able to work on it and provide a pull request ?

  • Yes
  • No
@donmccurdy
Copy link
Contributor

donmccurdy commented Aug 12, 2021

I'm relying on Caporal preserving source order in my own API, so that I can group commands into meaningful categories: https://gltf-transform.donmccurdy.com/cli.html ... so I just wanted to request that if this is supported, using source order remains available as an option.

Related, I wish I could use source order for sub-command options, but alphabetical order is currently enforced there. (#191)

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

No branches or pull requests

2 participants