summaryrefslogtreecommitdiffhomepage
path: root/scripts/gist
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-01-22 14:19:56 +0800
committertypebrook <typebrook@gmail.com>2020-01-22 14:19:56 +0800
commit5963ecf994c1142694603a088eb62faeb2c9f089 (patch)
treecc9efca23f7eed8b0767d22a1c4d78ab79e9b8e6 /scripts/gist
parentc56fa4f4f12c5f0af49bfb2ae235196ec0169775 (diff)
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-xscripts/gist23
1 files changed, 12 insertions, 11 deletions
diff --git a/scripts/gist b/scripts/gist
index ee7eed7..e83b3c2 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -276,17 +276,18 @@ _help_message() {
276} 276}
277 277
278_cases() { 278_cases() {
279 case "$1 $2" in 279 if [[ $1 == 'token' ]]; then
280 token[[:space:]]*) 280 [[ ${#2} -eq 40 ]] && echo token=$2 ||\
281 [[ ${#2} -eq 40 ]] && echo token=$2 ||\ 281 echo Invalid token format, it is not 40 chars '\n' > /dev/tty
282 echo Invalid token format, it is not 40 chars > /dev/tty;; 282 elif [[ $1 == 'auto_sync' ]]; then
283 auto_sync[[:space:]]*) ;& 283 echo $1=true
284 *false$) echo $1=$2 ;; 284 elif [[ $1 == 'folder' ]]; then
285 *) echo $1=true ;; 285 echo $1=$2
286 folder[[:space:]]*) echo $1=$2 ;; 286 elif [[ $1 == 'user' ]]; then
287 user[[:space:]]*) echo $1=$2 ;; 287 echo $1=$2
288 *) echo Not well formated > /dev/tty;; 288 else
289 esac 289 echo $1=
290 fi
290} 291}
291 292
292# TODO consider the case that $2 is empty -> remove original setting 293# TODO consider the case that $2 is empty -> remove original setting