help-gengetopt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-gengetopt] Re: [feature-request]: Indicate mandatory options


From: T
Subject: [help-gengetopt] Re: [feature-request]: Indicate mandatory options
Date: Sat, 30 Sep 2006 11:09:31 -0400
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux))

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?







reply via email to

[Prev in Thread] Current Thread [Next in Thread]