aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2020-07-01 23:50:20 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2020-07-01 23:50:20 +0800
commitd9726ca29a1e5f903ba1321f537b24154e43e235 (patch)
treec166af1d112ae0e3f9f620832f9b8093ff1a574f
parentc00a256502479779089cfd4d7fd41ef5b7d85722 (diff)
Reformat usage of pattern
-rwxr-xr-xgist6
1 files changed, 3 insertions, 3 deletions
diff --git a/gist b/gist
index f1770a0..594f323 100755
--- a/gist
+++ b/gist
@@ -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