We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2dae05e commit fc05af8Copy full SHA for fc05af8
argument-parser.sh
@@ -74,7 +74,18 @@ argGetName() {
74
}
75
76
argList() {
77
+ echo "ARGUMENTS:"
78
+ for arguments in "${!argExpected[@]}"
79
+ do
80
+
81
+ regexArgName="(.+) - (.+)"
82
+ [[ "${argExpected[$arguments]}" =~ $regexArgName ]]
83
84
+ local argumentName="${BASH_REMATCH[1]}"
85
+ local argumentDesc="${BASH_REMATCH[2]}"
86
+ echo " $arguments ($argumentName)"
87
+ echo " $argumentDesc"
88
+ done
89
90
91
argUnexpected() {
@@ -205,5 +216,7 @@ argParse() {
205
216
206
217
# If we are accessing this script directly run the argument parser, useful for testing
207
218
if [ "$0" == "$BASH_SOURCE" ]; then
219
+ argExpected['t']="test - this is a test"
208
220
argParse
221
+ argList
209
222
fi
0 commit comments