public class CmdLine extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PARAM_ARG_NAME_SEP |
static String |
PARAM_PREFIX |
static String |
PARAM_VALUE_SEP |
| Constructor and Description |
|---|
CmdLine() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getArg(String[] args,
String argName,
String dflt)
Emulates reading a Spring-like parameter if the configuration is not yet in place.
|
static int |
getIntArg(String[] args,
String argName,
int dflt)
Returns an int command line argument.
|
static void |
parseToArgs(String text,
List<String> cmds)
Parses given
text into individual arguments considering double quotes for string escapement with space
as a command separator. |
static void |
parseToArgs(String text,
List<String> cmds,
char separator)
Parses given
text into individual arguments considering double quotes for string escapement and
a given command separator. |
public static final String PARAM_PREFIX
public static final String PARAM_ARG_NAME_SEP
public static final String PARAM_VALUE_SEP
public static void parseToArgs(String text, List<String> cmds)
text into individual arguments considering double quotes for string escapement with space
as a command separator.text - the text to parsecmds - the commands (to be modified as a side effect)public static void parseToArgs(String text, List<String> cmds, char separator)
text into individual arguments considering double quotes for string escapement and
a given command separator.text - the text to parsecmds - the commands (to be modified as a side effect)separator - the separator (usually ' ')public static String getArg(String[] args, String argName, String dflt)
args - the argumentsargName - the argument name (without PARAM_PREFIX or PARAM_VALUE_SEP)dflt - the default value if the argument cannot be founddefltpublic static int getIntArg(String[] args, String argName, int dflt)
args - the argumentsargName - the argument name (without PARAM_PREFIX or PARAM_VALUE_SEP)dflt - the default value if the argument cannot be founddefltCopyright © 2021. All rights reserved.