TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG-DEVEL:12] Java getopt classes?
Quoting Perry Hoekstra (dutchman@uswest.net):
> Bob Tanner wrote:
> >
> > I am looking for tha getopt-like class(es) for Java. I really miss this niffty
> > little library when I migrated from C/C++ to Java.
> >
> > I'd really like to find something like getopt_long(3) functionality.
> >
>
> Not that I can help you, but can you explain what a getopt_long(3) does?
>
Got a linux box? :-)
man 3 getopt
The getopt() function parses the command line arguments.
Its arguments argc and argv are the argument count and
array as passed to the main() function on program invoca-
tion. An element of argv that starts with `-' (and is not
exactly "-" or "--") is an option element. The characters
of this element (aside from the initial `-') are option
characters. If getopt() is called repeatedly, it returns
successively each of the option characters from each of
the option elements.
The getopt_long() function works like getopt() except that
it also accepts long options, started out by two dashes.
Long option names may be abbreviated if the abbreviation
is unique or is an exact match for some defined option. A
long option may take a parameter, of the form --arg=param
or --arg param.
--
Bob Tanner <tanner@real-time.com> | Phone : (612)943-8700
http://www.real-time.com | Fax : (612)943-8500
Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9