help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] Re: Re: wishlist: mandatory parameters


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] Re: Re: wishlist: mandatory parameters
Date: Mon, 02 Oct 2006 11:36:18 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060927)

T wrote:
On Sun, 01 Oct 2006 13:55:07 +0200, Papp Gyozo (VBuster) wrote:

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

I search for the keyword "unnamed" in the manual but didn't find anything.

hint: gengetopt --help | grep -i unname

returns nothing.

it's a "unamed" :-)


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?

Yes.
But I guess it is hard to implement naming those unnamed options, and
I think it is better to let the main program handle the stored
parameters in the array 'inputs' of the args_info structure, not gengetopt.

if you try the candidate release I was talking about in my previous posts you can specify the usage string in order to get

Usage: sample1 [OPTIONS]... SOURCE DEST


What gengetopt can do, however, is to document those mandatory parameters.
After all that's the on-line help that users see. If they are not
documented in the on-line help, for the 99% of people who don't read man
pages, they have to try-and-error to know what parameters are mandatory.

yes the mandatory options (those with names like --input, -a, etc.) are now (in the candidate release whose url I sent in my previous post) printed in the output of help (provided that --show-required is passed to gengetopt as a parameter)

hope to hear from you soon
cheers
        Lorenzo

--
+-----------------------------------------------------+
|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Tel +39 055 4237460, Fax +39 055 4237437           |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        : http://www.lorenzobettini.it    |
|  http://music.dsi.unifi.it         XKlaim language  |
|  http://www.purplesucker.com Deep Purple Cover Band |
|  http://www.gnu.org/software/src-highlite           |
|  http://www.gnu.org/software/gengetopt              |
|  http://www.lorenzobettini.it/software/gengen       |
|  http://www.lorenzobettini.it/software/doublecpp    |
+-----------------------------------------------------+





reply via email to

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