Re: Options better be optional by default

Lorenzo Bettini <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
- Tong - wrote:
> Hi, 
> 
> Since release 2.17, there is a "required"/"optional" option that specifies
> whether defining option must be given or not. 

Hi Tong

actually this feature has always been present; the keywords were
"yes"/"no" which were quite obscure and so I changed them (yes and no
are still available though deprecated).

> 
> The current implementation is that if the option is not specified, e.g.,
> 
>  option          "long-opt"  - "A long option"  long argoptional
> 
> then the defining option is considered as mandatory, shown with 
> "--show-required" with release 2.19:
> 
>       --long-opt[=LONG]    A long option (mandatory)
> 
> I just hope that in such case (when no "required"/"optional" is defined),
> the defining option is considered optional by default, instead of mandatory. 

options have always been mandatory by default in gengetopt and changing
this would break previous code.

What I could do is to add a command line argument that permits
specifying that options are optional by default, what do you think?

cheers
	Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
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.