|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensolaris.opengrok.util.Getopt
public class Getopt
A simple implementation of the getopt(3c). It does just implement what I need ;-) Please note that I dislike the way GNU getopt allows mixing of options and arguments, so this version will stop processing options as soon as it encounters an argument.
| Constructor Summary | |
|---|---|
Getopt(java.lang.String[] argv,
java.lang.String opts)
Creates a new instance of Getopt |
|
| Method Summary | |
|---|---|
int |
getOpt()
Get the next option in the options string. |
java.lang.String |
getOptarg()
Get the argument to the current option |
int |
getOptind()
Get the index of the first argument |
void |
parse()
Parse the command lineoptions |
void |
reset()
Reset the current pointer so we may traverse all the options again.. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Getopt(java.lang.String[] argv,
java.lang.String opts)
argv - argument vectoropts - the list of allowed options| Method Detail |
|---|
public void parse()
throws java.text.ParseException
java.text.ParseException - if an illegal argument is passedpublic int getOpt()
public void reset()
public java.lang.String getOptarg()
public int getOptind()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||