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
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
+
46
+
By default if an argument is passed that hasn't been defined an error will be thrown and the script will exit.
47
+
This feature can be turned off by setting `ARG_MUST_BE_DEFINED` to `false`, note that the argument names will default to the argument its self, without the preceding hyphen(s).
48
+
7
49
### Get An Arguments Value
8
50
9
51
There is a helper function named `argValue()` which takes the name of
@@ -128,9 +170,9 @@ The order the arguments are passed on the command line makes a difference
128
170
129
171
* Calling `my-script.sh -f first -f last` will cause `argValue "f"` to return the value `last`
130
172
* Calling `my-script.sh -g 345 -g` will mean cause `argValue "g"` to return nothing
131
-
* Calling `my-script.sh --size 512 --size=1024` will mean cause `argValue "size"` to return 1024
173
+
* Calling `my-script.sh --size 512 --size=1024` will mean cause `argValue "size"` to return `1024`
132
174
133
175
## Debug Mode
134
176
135
-
There is a debug mode that can be enabled by setting the `ARG_DEBUG` variable at the top of the script to `true`.
177
+
There is a debug mode that can be enabled by setting the `ARG_DEBUG` variable to `true` right before calling `argParse`.
136
178
This will cause the script to dump out information about which flags it finds and of what kind etc
0 commit comments