Qore DebugUtil Module Reference
0.1
|
class supporting argument parsing for executing programs to debug More...
Inherits GetOpt.
Public Member Methods | |
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... | |
class supporting argument parsing for executing programs to debug
When implementing a wrapper that executes a program whose name is passed on the command line, we can divide the arguments usually into 3 groups:
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 xxx -v -l # the second xxx is target program name wrapper-prog -v -h xxx xxx # the first xxx is target program name wrapper-prog -v --listen=xxx xxx # the second xxx is target program name wrapper-prog -v --listen xxx xxx # the second xxx is target program name
DebugUtil::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 target program filename. "" is considered as special file name (stdin), NOTHING when no name provided |
pgm_args | return List of target program arguments |