[Gambas-user] Args help , most other places is -?

Benoit Minisini benoit.minisini at gambas-basic.org
Mon Jul 4 12:17:18 CEST 2022


Le 04/07/2022 à 11:43, Bruce Steers a écrit :
> 
> 
> On Sun, 3 Jul 2022 at 16:59, Benoit Minisini 
> <benoit.minisini at gambas-basic.org 
> <mailto:benoit.minisini at gambas-basic.org>> wrote:
> 
>     Le 02/07/2022 à 13:04, Bruce Steers a écrit :
>      >
>      >
>      > On Thu, 30 Jun 2022 at 13:21, Benoit Minisini
>      > <benoit.minisini at gambas-basic.org
>     <mailto:benoit.minisini at gambas-basic.org>
>      > <mailto:benoit.minisini at gambas-basic.org
>     <mailto:benoit.minisini at gambas-basic.org>>> wrote:
>      >
>      >     Le 30/06/2022 à 02:21, Bruce Steers a écrit :
>      >      >
>      >      > Fair point. Now I'm thinking harder I can't think of any other
>      >     reason
>      >      > myself other than -?
>      >      > Maybe I could make it check for -? With a property?
>      >     Args.QuestionMarkIsHelp
>      >
>      >     Just let the user handle both cases if he wants, and
>     implement both
>      >     options in the default help management.
>      >
>      >
>      > Problem was what if the user wants to use -? for help and -h for
>      > something else?  It was impossible as Args uses -h if you want it
>     to or
>      > not there was no choice.
>      > Last commit i removed the HelpShortName property that let you
>     change the
>      > help short name and replaced it for a simpler NoHelp property.
>      >
>      > Is that more acceptable?
>      > If Args.NoHelp = True then neither -h or --help is used and you
>     can then
>      > enter what ever you like manually.
>      >
>      > Respects
>      > BruceS
>      >
> 
>     'gb.args' is for implementing a standard command-line argument support.
>     As soon as the user wants to do something "stupid" (like using '-h' for
>     something other than help), I think 'gb.args' must not support it.
> 
>     This is the same reason why I think implementing simple option merge
>     ('-ab' == '-a -b') must not be optional.
> 
>     Regards,
> 
> 
> Sorry my friend but i can't help but disagree a bit.
> Personally i think -? is even better than -h for help, because it's 
> language universal.

Indeed, but it seems there is some sort of implicit standard of using 
"-h" for help almost everywhere (options are in english).

I wanted 'gb.args' to implement that implicit standard, not to handle 
all the different possible command-line syntaxes, so that it is the 
simplest possible.

For the same reason, I think grouping single character options is part 
of that implicit standard, and so I don't think it should be optional. 
"-ab" has no meaning in that syntax.

(I personnaly don't like these programs that do not follow this standard 
as much as possible).

If you start adding option for this and that, you will never finish, as 
there is a lot of different syntaxes possible. Maybe you should create 
another component, an advanced version of gb.args?

On the contrary, a possible "standard" command-line syntax that should 
be added to 'gb.args' is the support for "sub-command" of complex tools, 
like "git", where you type "git" followed by the sub command, and then 
the options that change according to the command.

Regards,

-- 
Benoît Minisini.


More information about the User mailing list