Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/config-ini/config.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; comments are allowed
hello = world
bashly = works

5 changes: 5 additions & 0 deletions examples/config-ini/configly
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ configly_list_command() {
# :src/list_command.sh
# Using the standard library (lib/config.sh) to show the entire config file
config_show

# Or to iterate through keys
for key in $(config_keys) ; do
echo "$key === $(config_get "$key")"
done
}

# :command.parse_requirements
Expand Down
5 changes: 5 additions & 0 deletions examples/config-ini/src/list_command.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Using the standard library (lib/config.sh) to show the entire config file
config_show

# Or to iterate through keys
for key in $(config_keys) ; do
echo "$key === $(config_get "$key")"
done
2 changes: 1 addition & 1 deletion lib/bashly/templates/lib/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ config_show() {
# done
#
config_keys() {
regex="^(.*)\s*="
regex="^([a-zA-Z0-9_\-]+)\s*="

config_init

Expand Down
3 changes: 3 additions & 0 deletions spec/approvals/examples/config-ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ world
+ ./configly get invalid_key
No such key: invalid_key
+ ./configly list
; comments are allowed
hello = world
bashly = works

hello === world
bashly === works