Skip to content

Commit 833e0b9

Browse files
committed
update ini example readme
1 parent aea796a commit 833e0b9

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

examples/ini/README.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ email = value for user.email
9898
## `src/get_command.sh`
9999

100100
```bash
101-
# Using the standard library (lib/config.sh) to show a value from the config
102-
config_load config.ini
101+
# Using the standard library (lib/ini.sh) to show a value from the config
102+
ini_load config.ini
103103
104104
key="${args[key]}"
105-
value=${config[$key]}
105+
value=${ini[$key]}
106106
107107
if [[ "$value" ]]; then
108108
echo "$key = $value"
@@ -115,29 +115,44 @@ fi
115115
## `src/list_command.sh`
116116

117117
```bash
118-
# Using the standard library (lib/config.sh) to show the entire config file
119-
config_load config.ini
120-
config_show
118+
# Using the standard library (lib/ini.sh) to show the entire config file
119+
ini_load config.ini
120+
ini_show
121121
122-
## Or to iterate through keys manually
123-
# for key in $(config_keys); do
124-
# echo "$key = ${config[$key]}"
122+
## Or iterate through keys manually
123+
# for key in $(ini_keys); do
124+
# echo "$key = ${ini[$key]}"
125125
# done
126126
```
127127

128128
## `src/set_command.sh`
129129

130130
```bash
131-
# Using the standard library (lib/config.sh) to store a value to the config
132-
config_load config.ini
131+
# Using the standard library (lib/ini.sh) to store a value to the config
132+
ini_load config.ini
133133
134134
key="${args[key]}"
135135
value="${args[value]}"
136136
137-
config["$key"]="$value"
138-
config_save saved.ini
137+
ini["$key"]="$value"
138+
ini_save saved.ini
139139
cat saved.ini
140140
141+
```
142+
143+
## `src/del_command.sh`
144+
145+
```bash
146+
# Using the standard library (lib/ini.sh) to delete a value from the config
147+
ini_load config.ini
148+
149+
key="${args[key]}"
150+
unset "ini[$key]"
151+
152+
ini_save saved.ini
153+
cat saved.ini
154+
155+
141156
```
142157

143158

0 commit comments

Comments
 (0)