Skip to content

Commit 0a9785f

Browse files
committed
Clarified that argument defaults are returned from argValue and that argExists checks if it was actually passed
1 parent 7978103 commit 0a9785f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ The default value can also be set to an empty string (`argExpected['e']="argumen
6565
There is a helper function named `argValue()` which takes the name of
6666
an argument as its only parameter and returns the value given to the argument.
6767

68-
If the argument doesn't have a value or hasn't been passed nothing is returned.
68+
If the argument doesn't have a value or hasn't been passed nothing is returned
69+
unless it's been given a default, in which case the default value will be returned.
6970

7071
```bash
7172
# -a 'some text'
@@ -103,6 +104,8 @@ esac
103104
There is a helper function named `argExists()` which takes the name of
104105
an argument as its only parameter and returns a boolean.
105106

107+
`argExist` will return false if the argument has fallen back to its default value*
108+
106109
```bash
107110
# -v
108111
if argExists 'v'; then

0 commit comments

Comments
 (0)