This is the mail archive of the
frysk@sources.redhat.com
mailing list for the frysk project.
Re: Getopt examples.
- From: Tom Tromey <tromey at redhat dot com>
- To: Nurdin Premji <npremji at redhat dot com>
- Cc: frysk at sourceware dot org
- Date: 28 Sep 2006 10:11:56 -0600
- Subject: Re: Getopt examples.
- References: <1159458888.2865.41.camel@tow.toronto.redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Nurdin" == Nurdin Premji <npremji@redhat.com> writes:
Nurdin> In the spirit of a tutorial on using getopt for your programs
Nurdin> here is a list of frysk files that now use getopt:
Thanks for writing this!
BTW feel free to send patches or make suggestions for the javadoc, I'd
like it to be as clear as possible. (Code changes are ok too :-)
Nurdin> parser.add(new Option ("long-name", 'l', "description of long name",
Nurdin> "<long name variable>"){});.
The GNU convention is that meta-syntactic variables are all uppercase.
Eg from appletviewer:
compatibilityGroup.add(new Option("encoding", Main.messages.getString
("gcjwebplugin.encoding_description"),
"CHARSET")
[...]
In the help this looks like:
-encoding CHARSET specify the HTML character encoding
Nurdin> Parser parser = new Parser("ftrace", "0.0", true) {
One thing we have in Classpath is a ClasspathToolParser class, which
is a subclass of Parser that sets the version number appropriately.
This idea may make sense for frysk as well.
Tom