[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guile-config: Command --help is not displayed when there are require
Re: guile-config: Command --help is not displayed when there are required arguments
Wed, 19 Feb 2020 08:56:13 -0500
---- On Wed, 19 Feb 2020 08:31:56 -0500 Alex Sassmannshausen <address@hidden>
> Hi Sirgazil,
> sirgazil <address@hidden> writes:
> > Hi,
> > When using "guile-config" for declaring my CLIs I've noticed that if I
> > define an argument as non-optional for a command, then trying to
> > display the --help of that command fails.
> You are correct. This issue arises because guile-config uses (ice-9
> getopt-long) internally to parse the command line arguments and handle
> all the usual gnu cli argument niceties.
> However this causes a chicken and egg problem: to execute help when the
> --help flag is provide we need to have parsed the cli options. But
> getopt-long throws an error whilst parsing the cli options as soon as it
> detects a mandatory argument is missing.
> This is not ideal. The solution would probably be have to be to
> re-implement cli argument parsing outside of getopt-long, or to patch
> getopt-long to not throw on validation-error but to return an
> error-structure, which includes the parsed cli args, but also any
> problems it encountered during validation.
> Dunno which is better at this point, but I'll log your report and my
> thoughts as a bug against guile-config for now.
> Of course, patches implementing either solution, welcome! :-)
I see. Thanks, Alex.
P.S.: I just noticed guile-config is also on GitLab (not just Github). I'll
report issues there in the future.