Re: Re: wishlist: mandatory parameters

"Papp Gyozo (VBuster)" <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
> I want, with the help of "mandatory parameter", it can be:
> 
>   Usage: sample1 [OPTIONS]... SOURCE DEST
> 
>   SOURCE mandatory parameter to ...
>   DEST ... copy SOURCE to DEST

Actually SOURCE and DEST is called unnamed options in gengetopt because as you figured out earlier it deals with options: ie. commandline arguments starting with one or two dashes. All above this (the rest) are assembled and stored into the array 'inputs' of the args_info structure, and are refered to unnamed options.

I think what you really want is to be able to name some of the unnamed options (SOURCE & DEST) and to use those as a normal mandatory parameters. If those are missing prgram exits with failure. Am I right?

hint: gengetopt --help | grep -i unname
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.