File tree Expand file tree Collapse file tree 1 file changed +28
-13
lines changed Expand file tree Collapse file tree 1 file changed +28
-13
lines changed Original file line number Diff line number Diff 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
104104key="${args[key]}"
105- value=${config [$key]}
105+ value=${ini [$key]}
106106
107107if [[ "$value" ]]; then
108108 echo "$key = $value"
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
134134key="${args[key]}"
135135value="${args[value]}"
136136
137- config ["$key"]="$value"
138- config_save saved.ini
137+ ini ["$key"]="$value"
138+ ini_save saved.ini
139139cat 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
You can’t perform that action at this time.
0 commit comments