public final class CommandLineUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String[] |
expandSingleLetterOptions(String[] args,
int idx,
Object... mapping)
Replaces 'combined' single-letter options (as in
"ls -lart" ) with 'long' options (as "ls -long
-all -reverse -time" ). |
public static String[] expandSingleLetterOptions(String[] args, int idx, Object... mapping)
"ls -lart"
) with 'long' options (as "ls -long
-all -reverse -time"
).args
- The command line arguments, e.g. "-foo", "-abc", "arg1", "arg2", "-bar"
idx
- The index of the command line argument to expand, e.g. 1 (designating "-abc"
)mapping
- Triplets of Character
s, String
s and Integer
s representing unexpanded
option, expanded option and option argument count, e.g. 'a', "-alpha", 1, 'b', "-beta", 0,
'c', "-gamma", 1
"-foo", "-alpha", "arg1", "-beta", "-gamma", "arg2",
"-bar"
Copyright © 2018 Arno Unkrig. All rights reserved.