T
Tom Anderson
Hello people,
If you want to process command-line arguments, doing things like
recognising flags, some of which may take parameters, how do you do it? In
C, you'd normally use getopt; many other languages provide comparable
utilities in their standard libraries (python has a getopt module, for
instance). Am i right in thinking the java standard library doesn't? (in
1.5, at least)? If so, are there almost-standard libraries (Apache commons
etc) that do? If not, what do you do? Is there something in com.sun that
could be used? How do javac and the other tools process their command
lines?
I once wrote a class to do it, using fairly basic rules, but i seem to
have misplaced my code. I could write it again from scratch fairly easily,
but i thought i'd see if there was a better alternative first.
tom
If you want to process command-line arguments, doing things like
recognising flags, some of which may take parameters, how do you do it? In
C, you'd normally use getopt; many other languages provide comparable
utilities in their standard libraries (python has a getopt module, for
instance). Am i right in thinking the java standard library doesn't? (in
1.5, at least)? If so, are there almost-standard libraries (Apache commons
etc) that do? If not, what do you do? Is there something in com.sun that
could be used? How do javac and the other tools process their command
lines?
I once wrote a class to do it, using fairly basic rules, but i seem to
have misplaced my code. I could write it again from scratch fairly easily,
but i thought i'd see if there was a better alternative first.
tom