public class CommandLine extends Object
Constructor and Description |
---|
CommandLine(String[] args)
Constructs the command line parser from the String[] array passed as the
argument to the application.
|
Modifier and Type | Method and Description |
---|---|
String[] |
allSwitchesStartingWith(String switch_str)
Returns a list of all switches on the command line that start with the
given string.
|
boolean |
containsSwitch(String switch_str)
Returns true if the switch is in the command line.
|
boolean |
containsSwitchFrom(String switch_str)
Given a comma deliminated list, this scans for one of the switches in the
list.
|
boolean |
containsSwitchStart(String switch_str)
Returns true if the command line contains a switch starting with the
given string.
|
String |
switchArgument(String switch_str)
Returns the contents of a switch variable if the switch is found on the
command line.
|
String |
switchArgument(String switch_str,
String def)
Returns the contents of a switch variable if the switch is found on the
command line.
|
String[] |
switchArguments(String switch_str,
int arg_count)
Returns the contents of a set of arguments found after a switch on the
command line.
|
public CommandLine(String[] args)
public boolean containsSwitch(String switch_str)
public boolean containsSwitchFrom(String switch_str)
public boolean containsSwitchStart(String switch_str)
public String[] allSwitchesStartingWith(String switch_str)
public String switchArgument(String switch_str)
Returns 'null' if the argument was not found.
public String switchArgument(String switch_str, String def)
Returns def if the argument was not found.
public String[] switchArguments(String switch_str, int arg_count)
Returns null if no match is found.
Copyright © 2015. All rights reserved.