[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-gengetopt] show help if no input
From: |
Lorenzo Bettini |
Subject: |
Re: [help-gengetopt] show help if no input |
Date: |
Wed, 18 Aug 2010 11:42:10 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 |
On 17/08/2010 22.15, Duke wrote:
Hi folks,
Hi there
I just heard about gengetopt, tried it and like it very much. I want
to change the default reaction of gengetopt a little bit to suit my
purpose better, so I have two questions below:
* When Print help, is there a way showing that one option is optional
and the other is required? For now, help shows only options and their
descriptions and values, no way to know if an option is optional or
required until one tries the program and some of its options.
for the moment this is not implemented, although in the summary of
command invocation optional options should be printed differently (I
should check this, I don't remember it right now and cannot check it now).
Surely, this behavior could be added (by using a command line switch of
gengetopt itself); I should work on this (or if you want to try to
implement it...)
* When there is no input (no argument or argc < 2), is there a way of
telling gengetopt to show help, even if there are required options?
For now, if there is required option, and if the program is invoked
without argument, then "option required" shows up, not the help.
this could be implemented in your program itself; as long as you init an
args_info structure, then you could check argc and in case call the
print help generated function directly; have you tried this?
hope to hear from you soon
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
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