You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Provided function will be executed if the given tag is provided as an argument with or without a value.
129
-
- FunctionOption is parsed like [`ValueOption`](###ValueOption).
130
-
- FunctionMultiOption is parsed like [`MultiOption`](###MultiOption).
131
-
- FunctionTaglessOption is parsed like [`TaglessOption`](###TaglessOption).
197
+
- FunctionOption is parsed like [`ValueOption`](#ValueOption).
198
+
- FunctionMultiOption is parsed like [`MultiOption`](#MultiOption).
199
+
- FunctionTaglessOption is parsed like [`TaglessOption`](#TaglessOption).
200
+
201
+
### **Option Functions**
202
+
203
+
- Option
204
+
-**exists()** -> option is present in the arguments list
205
+
-**existsCount()** -> returns the number the option is present i.e -a -a -a will return 3
206
+
-**value()** -> returns the raw argument value
207
+
-**valueAs<T>** -> converts the raw argument to the given type
208
+
-**valueBool()** -> returns true if argument is "1" or "True" or "true" or "t" or "y"
209
+
-**execute()** -> only available with [`Function Options`](#FunctionOption/FunctionMultiOption/FunctionTaglessOption)
210
+
-**values()** / **valuesAs<T>()** / **valuesBool()** -> same as their value counterpart but returns all provided values
211
+
212
+
## Customizations
213
+
214
+
### Asking For User Input When Mandatory Options Are Not Provided
215
+
216
+
- Call **userInputRequired()** in your program, user will be asked to input values for your mandatory values.
217
+
- For inputs, input stream could be changed to your choosen stream via **changeIO()**
218
+
219
+
```c++
220
+
Cli po(argc, argv);
221
+
po.userInputRequired();
222
+
```
223
+
224
+
### Making Invalid/Expanded Arguments Acceptable
225
+
226
+
- For example; when using tagless options, only 3 arguments are needed but calling the program with 4 arguments will cause to exit due to the unexpected argument.
227
+
- This behaviour could be used to accept expanded files provided to the program such as "myprogram -a *.txt"
228
+
- When used with other options, valid options will be parsed and program won't exit.
229
+
230
+
```c++
231
+
Cli po(argc, argv);
232
+
po.add(3);
233
+
po.unexpectedArgumentsAcceptable();
234
+
```
235
+
236
+
### Disabling Auto Help
237
+
238
+
- You can simply disable "-h" option by defining the value below before the header definition.
0 commit comments