| Package | system.cli |
| Class | public class ArgumentsParser |
Example :
my.exe -h
my.exe /?
my.exe -s -T:hello myfile.txt
my.exe myfile1.txt myfile2.txt
Note :we don't want to use events for Tamarin compatibility.
| Method | Defined by | ||
|---|---|---|---|
|
ArgumentsParser(switchSymbols:Array, caseSensitive:Boolean = false, switchChars:Array = null)
Creates a new ArgumentParser instance.
| ArgumentsParser | ||
|
onNonSwitch(value:String):SwitchStatus
Used to display the usage string when a non switch occurs.
| ArgumentsParser | ||
|
Used to display the usage string when a parse occurs.
| ArgumentsParser | ||
|
onSwitch(symbol:String, value:String):SwitchStatus
Used to display the usage string when a switch occurs.
| ArgumentsParser | ||
|
onUsage(errorInfo:String = ""):void
Used to display the usage string when an error occurs.
| ArgumentsParser | ||
|
parse(args:Array):Boolean
Invoked to parse the specified Array of arguments.
| ArgumentsParser | ||
| ArgumentsParser | () | constructor |
public function ArgumentsParser(switchSymbols:Array, caseSensitive:Boolean = false, switchChars:Array = null)Creates a new ArgumentParser instance.
ParametersswitchSymbols:Array — The Array representation of all switch symbols.
|
|
caseSensitive:Boolean (default = false) — Indicates if the case sensitive is enabled.
|
|
switchChars:Array (default = null) — The Array of all switch characters.
|
| onNonSwitch | () | method |
public function onNonSwitch(value:String):SwitchStatusUsed to display the usage string when a non switch occurs. Need to be overrided.
Parametersvalue:String |
SwitchStatus |
| onParsed | () | method |
public function onParsed():SwitchStatusUsed to display the usage string when a parse occurs. Need to be overrided.
ReturnsSwitchStatus |
| onSwitch | () | method |
public function onSwitch(symbol:String, value:String):SwitchStatusUsed to display the usage string when a switch occurs. Need to be overrided.
Parameterssymbol:String |
|
value:String |
SwitchStatus |
| onUsage | () | method |
public function onUsage(errorInfo:String = ""):voidUsed to display the usage string when an error occurs. Need to be overrided.
ParameterserrorInfo:String (default = "") |
| parse | () | method |
public function parse(args:Array):BooleanInvoked to parse the specified Array of arguments.
Parametersargs:Array |
Boolean |