posixArguments
fun posixArguments(flags: List<Char>, longFlags: List<String>, parameters: List<String>, args: Array<out String>): Arguments
See POSIX Conventions for Command Line Arguments
In order to parse, we need to know which characters are flags, which strings are option names, and if the option has an argument (or is just a long form of a flag).
For example, this could be parsed in many ways :
myProgram -abc -de foo bar
Content copied to clipboard
If abc
is an option with no value, then it is a long name for a flag. If -abc
is an option with a value, then the value is -de
. If a
is an option with a value, then the value is bc
. If abc
isn't an option, then it is three flags, a
, b
, c
.
IMHO, this is a mess, and I would never use it.
Parameters
flags
A list of single-character flags
longFlags
A list of multi-character flags
parameters
A list of parameter names
args
The arguments to be parsed (the values passed to the program's main
method)