Qore DebugCmdLine Module Reference
0.1.2
|
Inherits GetOpt.
Public Member Methods | |
constructor (hash options) | |
create the object with the given GetOpt option hash | |
split (list< string > args, reference< list< string >> wrp_args, reference< *string > pgm_name, reference< list< string >> pgm_args) | |
Parses input arguments until a standalone argument is found. More... | |
When implementing a wrapper which executes program whose name is passed at command line then we can divide arguments usually into 3 groups, internal wrapper arguments, target program filename and program arguments. The class support argument parsing for such a case.
Examples: ( # GetOpt options 'help': 'h,help', 'verbose': 'v,verbose', 'listen': 'l,listen=s@', ); wrapper-prog -v -l xxx trg -v -l # trg is the target program name wrapper-prog -v -h trg xxx # trg is the target program name wrapper-prog -v –listen=xxx trg # trg is the target program name wrapper-prog -v –listen xxx trg # trg is the target program name
DebugCmdLine::WrapperGetOpt::split | ( | list< string > | args, |
reference< list< string >> | wrp_args, | ||
reference< *string > | pgm_name, | ||
reference< list< string >> | pgm_args | ||
) |
Parses input arguments until a standalone argument is found.
args | List of arguments passed to wrapper, typically ARGV |
wrp_args | returns list of wrapper arguments |
pgm_name | returns the target program filename; "" is considered a special file name (meaning stdin ), NOTHING when no name provided |
pgm_args | return List of target program arguments |