Skip to content

Commit 4a90793

Browse files
committed
Added a section to the README about defining expected arguments
1 parent 4e8c698 commit 4a90793

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,29 @@ argExpected['R']="secondArgName - This is another argument that can be passed"
2020
argParse
2121
```
2222

23+
### Defining Expected Arguments
24+
25+
The argument parser can take an array of arguments to expect, it has the following format:
26+
27+
```bash
28+
# Define the -r argument
29+
argExpected['r']="argumentName - Argument description"
30+
31+
# Define the --test argument
32+
argExpected['test']="argumentName - Argument description"
33+
34+
# Define both the -u and --uniform arguments
35+
argExpected['u|uniform']="argumentName - Argument description"
36+
37+
# Define both the -a and -A arguments
38+
argExpected['u|A']="argumentName - Argument description"
39+
40+
# Define the -d, --deamon and -D arguments
41+
argExpected['d|deamon|D']="argumentName - Argument description"
42+
```
43+
44+
The `argumentName` part of the definition is the name given to the argument and what should be passed to the `argValue` and `argExists` functions, see below.
45+
2346
### Get An Arguments Value
2447

2548
There is a helper function named `argValue()` which takes the name of

0 commit comments

Comments
 (0)