diff options
author | Hsieh Chin Fan <typebrook@gmail.com> | 2020-07-01 23:50:20 +0800 |
---|---|---|
committer | Hsieh Chin Fan <typebrook@gmail.com> | 2020-07-01 23:50:20 +0800 |
commit | d9726ca29a1e5f903ba1321f537b24154e43e235 (patch) | |
tree | c166af1d112ae0e3f9f620832f9b8093ff1a574f | |
parent | c00a256502479779089cfd4d7fd41ef5b7d85722 (diff) |
Reformat usage of pattern
-rwxr-xr-x | gist | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -157,9 +157,9 @@ _process_json() { | |||
157 | _configure() { | 157 | _configure() { |
158 | [[ $# == 0 ]] && ${EDITOR:-vi} $CONFIG && return 0 | 158 | [[ $# == 0 ]] && ${EDITOR:-vi} $CONFIG && return 0 |
159 | 159 | ||
160 | local key=$1; local value="$2" | 160 | local key=$1; local value="$2"; valid_configs=${VALID_CONFIGS[@]} |
161 | [[ ! " ${VALID_CONFIGS[@]} " =~ " ${key} " ]] \ | 161 | [[ ! ${key} =~ ^(${valid_configs// /|})$ ]] \ |
162 | && echo "Not a valid key for configuration, use <${VALID_CONFIGS[@]}> instead." \ | 162 | && echo "Not a valid key for configuration, use <${valid_configs[@]// /|}> instead." \ |
163 | && return 1 | 163 | && return 1 |
164 | 164 | ||
165 | case $key in | 165 | case $key in |