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

Grouping commands into sections #189

Open
1 of 2 tasks
donmccurdy opened this issue Jul 9, 2020 · 3 comments
Open
1 of 2 tasks

Grouping commands into sections #189

donmccurdy opened this issue Jul 9, 2020 · 3 comments
Labels

Comments

@donmccurdy
Copy link
Contributor

donmccurdy commented Jul 9, 2020

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

My CLI has a growing number of commands that work independently — I don't think they make sense as subcommands— and they start to look overwhelming when presented as a list.

Describe the solution you'd like
I'd love to be able to group my commands into sections in the --help output, without changing how they're invoked. Maybe with help text associated with each section, but that's just a nice-to-have. For example:

USAGE

    ▸ gltf-transform <command> [ARGUMENTS...] [OPTIONS...]


  COMMANDS — Type 'gltf-transform help <command>' to get some help about a command

    GENERAL — Inspect, copy, and combine files.

    inspect                              Inspect the contents of the model
    list                                 List a model's resources of a given type
    repack                               Rewrites the model with minimal changes

    MODIFY — Enhance or alter file content.

    ao                                   Bakes per-vertex ambient occlusion
    colorspace                           Colorspace correction for vertex colors
    prune                                Prunes duplicate binary resources
    split                                Splits mesh data into separate .bin files
    unlit                                Converts materials to an unlit, shadeless model

    OPTIMIZE — Optimize file for runtime performance.

    quantize                                   Quantize geometry and animation data
    resample                                   Resample animations at a given FPS

    COMPRESS — Compress file for transmission.

    ktx                                   Compress textures with KTX
    draco                                   Compress geometry with Draco
    gzip                                   Compress the entire file with gzip

  GLOBAL OPTIONS

    -h, --help                           Display global help or command-related help.
    -V, --version                        Display version.
    -v, --verbose                        Verbose mode: will also output debug messages.

Describe alternatives you've considered

Tried .help() and the sectionName option. Does the right thing, but not for the content I want to group. :)

Context

https://gltf-transform.donmccurdy.com/

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

  • Yes
  • No
@donmccurdy
Copy link
Contributor Author

I more or less solved my own problem using emoji, so feel free to close this. 🙂

Screen Shot 2020-07-09 at 6 22 22 PM

@beorn
Copy link

beorn commented Aug 22, 2020

I think it'd still be nice to be able to group commands like you suggested.

@donmccurdy
Copy link
Contributor Author

Don't know if this is a good idea necessarily, but I've got a nicer visual result now by using empty commands and newlines as section dividers:

Screen Shot 2020-08-27 at 4 21 23 PM

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

No branches or pull requests

3 participants