Skip to content

Commit 64e93fa

Browse files
committed
fix shellcheck
1 parent d879ae1 commit 64e93fa

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

examples/config/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ else
8484
echo "No such key: $key"
8585
fi
8686
87-
# Example of how to assign the config value to a variable:
88-
# result=$(config_get "${args[key]}")
89-
# echo $result
87+
# Or, assign a default value if value not found
88+
config_get "$key" "the default value"
89+
90+
# Or, assign the result to a variable
91+
result=$(config_get "$key")
92+
echo "$result"
9093
9194
9295
```
@@ -162,6 +165,8 @@ saved: bashly = works
162165

163166
```shell
164167
world
168+
world
169+
world
165170
166171
167172
```
@@ -170,6 +175,8 @@ world
170175

171176
```shell
172177
No such key: invalid_key
178+
the default value
179+
173180
174181
175182
```

examples/config/src/get_command.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ config_get "$key" "the default value"
1212

1313
# Or, assign the result to a variable
1414
result=$(config_get "$key")
15-
echo $result
15+
echo "$result"
1616

0 commit comments

Comments
 (0)