@@ -36,6 +36,15 @@ flags:
3636 # needs to be converted to an array with `eval "data=(${args[--data]})"`
3737 repeatable : true
3838
39+ - long : --path
40+ short : -p
41+ arg : location
42+ help : Specify one or more paths
43+ repeatable : true
44+
45+ # Setting this to true will ignore repeating arguments that are not unique
46+ unique : true
47+
3948- long : --verbose
4049 short : -v
4150 help : Set verbosity level
4756
4857examples :
4958- download -d one -d "two three" -vvv
59+ - download -d one -p /usr/bin -p /tmp
5060` ` ` `
5161
5262# # `src/root_command.sh`
@@ -61,7 +71,7 @@ for i in "${data[@]}"; do
6171done
6272
6373# The --verbose arg will contain the number of times it was used by the user
64- verbose=${args[--verbose]}
74+ verbose=${args[--verbose]:-1 }
6575echo ""
6676echo "Verbosity level : $verbose"
6777echo ""
@@ -87,6 +97,9 @@ Options:
8797 --data, -d DATA (required) (repeatable)
8898 Provide data values
8999
100+ --path, -p LOCATION (repeatable)
101+ Specify one or more paths
102+
90103 --verbose, -v (repeatable)
91104 Set verbosity level
92105
@@ -98,6 +111,7 @@ Options:
98111
99112Examples:
100113 download -d one -d " two three" -vvv
114+ download -d one -p /usr/bin -p /tmp
101115
102116
103117
@@ -119,5 +133,20 @@ args:
119133
120134````
121135
136+ ### ` $ ./download -d one --path /bin --path /usr/lib --path /bin `
137+
138+ ```` shell
139+ Data elements:
140+ one
141+
142+ Verbosity level: 1
143+
144+ args:
145+ - ${args[--data]} = " one"
146+ - ${args[--path]} = " /bin" " /usr/lib"
147+
148+
149+ ````
150+
122151
123152
0 commit comments