TanklesXL / glint

Gleam command-line argument parsing with flags and automated help text generation.
https://hex.pm/packages/glint
Apache License 2.0
50 stars 7 forks source link

✨ Add the ability to hide `[ ARGS ]` from default help text. #20

Closed hayleigh-dot-dev closed 4 months ago

hayleigh-dot-dev commented 6 months ago

I'm experimenting with using glint to configure lustre's preview web server. The default help text prints like this:

% gleam run -m lustre/try -- --help
  Compiling lustre
   Compiled in 0.18s
    Running lustre/try.main
USAGE:
        lustre/try [ ARGS ] [ --host=<INT> --include-styles=<BOOL> --port=<STRING> ]

FLAGS:
        --help                  Print help information
        --host=<INT>            The port to run the server on
        --include-styles=<BOOL>         Include lustre_ui's stylesheet in your app.
        --port=<STRING>         The host to run the server on

This is really great except for the fact that this command will never have anything that could be a valid arg and showing [ ARGS ] makes it sound possible. I'd rather not write my own help text from scratch, so it'd be helpful if glint had a way for me to say "this thing doesn't take arguments, don't document them" somewhere.

TanklesXL commented 4 months ago

now possible with glint.unnamed_flags(glint.EqArgs(0))