File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 22
33Takes arguments passed in nearly any format to a bash script and allows easy access to them and their values
44
5+ ## Use
6+
7+ ### Get An Arguments Value
8+
9+ Get the value of the ` --debug 3 ` flag
10+
11+ ``` bash
12+ DEBUG=" ${args['debug']} " # 3
13+ ```
14+
15+ ### Check If An Argument Has Been Passed
16+
17+ Check for the ` -v ` flag
18+
19+ ``` bash
20+ if argExists ' v' ; then
21+ echo " The -v flag has been passed"
22+ fi
23+
24+ # Or
25+
26+ argExists ' v' && echo " Verbosity Enabled"
27+ ```
28+
29+ Check for the ` --test ` flag
30+
31+ ``` bash
32+ if argExists ' test' ; then
33+ echo " The --test flag has been passed"
34+ fi
35+
36+ # Or
37+
38+ argExists ' test' && echo " Testing enabled"
39+ ```
40+
541## Supported Argument Formats
642
743### Short Form
You can’t perform that action at this time.
0 commit comments