This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getopt examples.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]