diff options
-rwxr-xr-x | scripts/gist | 23 |
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 |