public class CommandLineTokenizer
extends java.lang.Object
A utility class to parse a command line contained in a single String into
an array of argument tokens, much as the JVM (or more accurately, your
operating system) does before calling your programs' public static
void main(String[] args)
methods.
This class has been developed to parse the command line in the same way that MS Windows 2000 does. Arguments containing spaces should be enclosed in quotes. Quotes that should be in the argument string should be escaped with a preceding backslash ('\') character. Backslash characters that should be in the argument string should also be escaped with a preceding backslash character.
WheneverJSAP.parse(String)
is called, the specified String is
tokenized by this class, then forwarded to JSAP.parse(String[])
for further processing.Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
tokenize(java.lang.String commandLine)
Parses the specified command line into an array of individual arguments.
|
public static java.lang.String[] tokenize(java.lang.String commandLine)
commandLine
- the command line to parse