diff options
Diffstat (limited to 'scripts/gist')
| -rwxr-xr-x | scripts/gist | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/gist b/scripts/gist index 2582ea4..e6b091c 100755 --- a/scripts/gist +++ b/scripts/gist | |||
| @@ -138,6 +138,7 @@ starred=$folder/starred | |||
| 138 | # TODO a way to show files | 138 | # TODO a way to show files |
| 139 | # TODO show git status outdated | 139 | # TODO show git status outdated |
| 140 | _show_list() { | 140 | _show_list() { |
| 141 | # FIXME how about starred file | ||
| 141 | if [[ ! -e "$1" ]]; then | 142 | if [[ ! -e "$1" ]]; then |
| 142 | echo 'No local file found for last update, please run command:' | 143 | echo 'No local file found for last update, please run command:' |
| 143 | echo " gist update" | 144 | echo " gist update" |
| @@ -312,19 +313,19 @@ _show_detail() { | |||
| 312 | | AccessJsonElement "$(_handle_comment)" | 313 | | AccessJsonElement "$(_handle_comment)" |
| 313 | } | 314 | } |
| 314 | 315 | ||
| 315 | # FIXME put file before parameters | ||
| 316 | _set_gist() { | 316 | _set_gist() { |
| 317 | while [[ "$1" =~ ^- && "$1" != "--" ]]; do case $1 in | 317 | while [[ -n "$@" ]]; do case $1 in |
| 318 | -d | --desc) | 318 | -d | --desc) |
| 319 | description="$2" | 319 | description="$2" |
| 320 | shift; shift;; | 320 | shift; shift;; |
| 321 | -f | --file) | 321 | -f | --file) |
| 322 | filename="$2" | 322 | filename="$2" |
| 323 | shift; shift;; | 323 | shift; shift;; |
| 324 | *) | ||
| 325 | files="$1 $files" | ||
| 326 | shift;; | ||
| 324 | esac | 327 | esac |
| 325 | done | 328 | done |
| 326 | if [[ "$1" == '--' ]]; then shift; fi | ||
| 327 | files="$@" | ||
| 328 | ls $files > /dev/null || return 1 | 329 | ls $files > /dev/null || return 1 |
| 329 | } | 330 | } |
| 330 | 331 | ||