Packagesystem.cli
Classpublic class ArgumentsParser

Parse command line arguments.

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.



Public Methods
 MethodDefined 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
Constructor detail
ArgumentsParser()constructor
public function ArgumentsParser(switchSymbols:Array, caseSensitive:Boolean = false, switchChars:Array = null)

Creates a new ArgumentParser instance.

Parameters
switchSymbols: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.
Method detail
onNonSwitch()method
public function onNonSwitch(value:String):SwitchStatus

Used to display the usage string when a non switch occurs. Need to be overrided.

Parameters
value:String

Returns
SwitchStatus
onParsed()method 
public function onParsed():SwitchStatus

Used to display the usage string when a parse occurs. Need to be overrided.

Returns
SwitchStatus
onSwitch()method 
public function onSwitch(symbol:String, value:String):SwitchStatus

Used to display the usage string when a switch occurs. Need to be overrided.

Parameters
symbol:String
 
value:String

Returns
SwitchStatus
onUsage()method 
public function onUsage(errorInfo:String = ""):void

Used to display the usage string when an error occurs. Need to be overrided.

Parameters
errorInfo:String (default = "")
parse()method 
public function parse(args:Array):Boolean

Invoked to parse the specified Array of arguments.

Parameters
args:Array

Returns
Boolean