Lines Matching full:argument
7 …r-only utility tool that helps to parse command line arguments. It supports several argument types:
23 pandargs API consists of two major entities: template class `PandArg`, which represents an argument…
30 To create an argument, it's template constructor should be called. Here is an instance:
33 // argument name | default value | argument description
34 panda::PandArg<bool> pab("bool", false, "Sample boolean argument");
35 // argument name | argument description | sub-arguments
36 …PandArgCompound arg("compound", "Sample boolean argument", {&sub_bool_arg, &sub_int_ar…
40 - 3 parameters: argument name, default value, description.
41 - 4 parameters for single list: argument name, default value, description, delimiter.
42 - 5 parameters for integer args: argument name, default value, description, min value, max value
43 - PandArgCompound accepts three parameters: argument name, description and list of sub-arguments
46 - Argument name, is a name, which will appear in a command line.
47 - Default value is a value argument will have regardless was it parsed or not.
48 - Argument description will be used to form a help message.
49 - Delimiter is a character or string that separates the different value if the single argument list
50 - Min value is the number that the integer argument cannot be less than
51 - Max value is the number that the integer argument cannot be greater than
55 Template parameter is an argument type. Following values could be passed:
56 - `int` for integer argument
57 - `double` for double argument
58 - `bool` for boolean argument
59 - `std::string` for string argument
60 - `uint64_t` for uint64_t argument
61 - `uint32_t` for uint32_t argument
62 - `arg_list_t` for list argument
67 - `PandArgType GetType()` - returns type of an argument
68 - `std::string GetName()` - returns name of an argument
69 - `std::string GetDesc()` - returns description of an argument
70 - `T GetValue()` - returns value of an argument depending on it's type
71 - `T GetDefaultValue()` - returns default value of an argument
72 - `void SetValue(T val)` - set value of an argument
75 #### Argument types
76 There are three global argument types in pandargs:
85 Compound argument is a boolean argument, which can contains sub-arguments, followed by symbol `:`,
87 and can be any type of argument. Compound arguments implicitly have default value `false` and user …
90 contains name of the compound argument plus name of the sub-argument.
96 …g)` - add an argument to parser. Returns `true` if argument was succsessfully added. `PandArgBase`…
98 - `std::string GetErrorString()` - returns error string if error occurred on argument addition or p…
102 - `bool IsArgSet(PandArgBase* arg)` - returns `true` if an argument was added to a parser
103 - `bool IsArgSet(const std::string& arg_name)` - returns `true` if an argument with given name was …
104 …l PushBackTail(PandArgBase* arg)` - add tail argument to the end of tail arguments list. `false` i…
105 - `bool PopBackTail()` - remove last argument from tail list
107 - `void EnableRemainder()` - enable remainder argument
108 - `void DisableRemainder()` - disable remainder argument
109 - `bool IsRemainderEnabled()` - `true` if remainder argument enabled
110 - `arg_list_t GetRemainder()` - returns remainder argument
114 …argument is a sequence of positinal arguments values. Function ```PushBackTail()``` adds an argume…
131 - Any non-positional argument should start with `--` (double dash) prefix
132 - Argument and it's value may be separated either by whitespace (` `) or by equals (`=`) sign
133 - If tail (positional arguments) enabled, first argument without double dash prefix concidered as a…
135 - Boolean argument may be used without a value. This arguments always considered as `true`
154 $ ./app --list=val1 --list=val2 --list=val3 # list argument example
155 $ ./app --slist=val1:val2:val3 # list argument example
159 $ ./app --compound:bool,int=2,double=54.321,string=Hello # Compound argument example
161 …r value and `str1` and `str2` is a string value. List may not be a tail argument. Positional value…
168 // now pab will be processed as a positional argument