![]() |
PIP 5.5.3
Platform-Independent Primitives
|
Command-Line parser. More...
#include <picli.h>
Public Member Functions | |
| PICLI (int argc, char *argv[]) | |
| Constructs PICLI from "argc" and "argv" from "int main()" method. | |
| void | addArgument (const PIString &name, bool value=false) |
| Add argument with name "name", short key = name first letter and full key = name. | |
| void | addArgument (const PIString &name, const PIChar &shortKey, bool value=false) |
| Add argument with name "name", short key = "shortKey" and full key = name. | |
| void | addArgument (const PIString &name, const char *shortKey, bool value=false) |
| Add argument with name "name", short key = "shortKey" and full key = name. | |
| void | addArgument (const PIString &name, const PIChar &shortKey, const PIString &fullKey, bool value=false) |
| Add argument with name "name", short key = "shortKey" and full key = "fullKey". | |
| void | addArgument (const PIString &name, const char *shortKey, const PIString &fullKey, bool value=false) |
| Add argument with name "name", short key = "shortKey" and full key = "fullKey". | |
| PIString | rawArgument (int index) |
| Returns unparsed command-line argument by index "index". Index 0 is program execute command. | |
| const PIStringList & | rawArguments () |
| Returns unparsed command-line arguments. | |
| PIString | programCommand () |
| Returns program execute command without arguments. | |
| bool | hasArgument (const PIString &name) |
| Returns if argument "name" found. | |
| PIString | argumentValue (const PIString &name) |
| Returns argument "name" value, or empty string if this is no value. | |
| PIString | argumentShortKey (const PIString &name) |
| Returns short key of argument "name", or empty string if this is no argument. | |
| PIString | argumentFullKey (const PIString &name) |
| Returns full key of argument "name", or empty string if this is no argument. | |
Command-Line parser.
This class provide handy parsing of command-line arguments. First you should add arguments to PICLI with function addArgument(). Then you can check if there is some argument in application command-line with function hasArgument(), or obtain argument value by argumentValue().
These executions are similar: