Re: [feature-request]: Indicate mandatory options

T <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
1st of all, thanks for all your replies Lorenzo. It really gives a warm
feeling to a newcomer like me.

On Sat, 30 Sep 2006 10:32:44 +0200, Lorenzo Bettini wrote:

>> I noticed that the mandatory options ("required") are not indicated on the
>> usage help message. 
>> 
> 
> you mean in the usage line?
> 
> they are shown, provided you run gengetopt with the option --long-help, 
> e.g., the sample1:
> 
> Usage: sample1 -iINT|--int-opt=INT [-h|--help] [--full-help] 
> [-V|--version] -sfilename|--str-opt=filename -mINT|--my-opt=INT 
> [--flag-opt] [-F|--funct-opt] --long-opt=LONG --def-opt=STRING 
> --enum-opt=STRING -DINT|--dependant=INT  [FILES]...

Oh, I didn't know that.

> is that what you meant?

I meant the usage help message:

$ grep required sample0.ggo
option  "str-opt"         s "A string option, for a filename"      string typestr="filename"     required
option  "long-opt"        - "A long option"        long       required

$ gengetopt --show-help -i sample0.ggo | grep -- '[rg]-opt'
  -s, --str-opt=filename  A string option, for a filename
      --flag-opt          A flag option  (default=off)
      --long-opt=LONG     A long option
  -D, --dependant=INT     option that depends on str-opt

I think it is a good idea to indicate which options are required here also. 
E.g.,

      --long-opt=LONG     A long option (mandatory)

or something like that. 

what do you think?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.