|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.homeunix.thecave.moss.util.ParseCommands
public class ParseCommands
This class makes Unix style command line parsing easy for Java applications. Please see below for instructions on how to use it.
For a copy of the LGPL license, please see http://www.gnu.org/copyleft/lesser.html
Copyright (C) 2005 by Wyatt Olson
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA To use, simply create a collection of ParseVariable objects of the correct types, and pass them to the static parse() method. The return value of this is a ParseResults object, which you can then extract the values from.
| Nested Class Summary | |
|---|---|
static class |
ParseCommands.ParseResults
|
static class |
ParseCommands.ParseVariable
|
| Constructor Summary | |
|---|---|
ParseCommands()
|
|
| Method Summary | |
|---|---|
static ParseCommands.ParseResults |
parse(java.lang.String[] args,
java.lang.String help,
java.util.Collection<ParseCommands.ParseVariable> flags)
Parses command line arguments, and returns them as a mapping of flag (-x) to variable. |
static ParseCommands.ParseResults |
parse(java.lang.String[] args,
java.lang.String help,
ParseCommands.ParseVariable... flags)
Parses command line arguments, and returns them as a mapping of flag (-x) to variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParseCommands()
| Method Detail |
|---|
public static ParseCommands.ParseResults parse(java.lang.String[] args,
java.lang.String help,
java.util.Collection<ParseCommands.ParseVariable> flags)
args - Command line argument as given to the main methodhelp - The usage instructions which are shown if the command is type incorrectly.flags - Collection of ParseVariables to define which flags to look for.
ParseException
public static ParseCommands.ParseResults parse(java.lang.String[] args,
java.lang.String help,
ParseCommands.ParseVariable... flags)
args - Command line argument as given to the main methodhelp - The usage instructions which are shown if the command is type incorrectly.flags - One or more ParseVariables to define which flags to look for.
ParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||