From a110947e5a673181cbcc14c3e4e92ed30c94efc4 Mon Sep 17 00:00:00 2001 From: typebrook Date: Mon, 20 Jan 2020 11:28:25 +0800 Subject: update --- scripts/gist | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'scripts/gist') diff --git a/scripts/gist b/scripts/gist index 3d355c5..f7f662a 100755 --- a/scripts/gist +++ b/scripts/gist @@ -18,32 +18,35 @@ # # * clone gist repos which are not in local # * pull master branch if a local repo is behind its remote -# gist [sync | s] +# gist (sync | s) # # * Go to local gist repo # . gist # -# * create a new gist with a file and description -# gist [new | n] "" +# * create a new gist with files +# gist (new | n) [-d | --desc ""] ... +# +# * create a new gist with STDIN +# gist (new | n) [-d | --desc ""] [-f | --file ] < # # * show the detail of a gist -# gist [detail | d] +# gist (detail | d) # # * edit a gist description -# gist [edit | e] +# gist (edit | e) # # * delete a gist -# gist [delete | D] +# gist (delete | D) ... # # * clean removed gists in local -# gist [clean | C] +# gist (clean | C) # # * update a gist # Since now a gist is a local cloned repo # It is your business to do git commit and git push # # * show this help message -# gist [help | h] +# gist (help | h) # define your environmemnts here # TODO support auth prompt, remove personal info here @@ -201,14 +204,15 @@ _new_file() { _set_gist() { while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in - -d) + -d | --desc) description="$2" shift; shift;; - -f) + -f | --file) filename="$2" shift; shift;; esac done + if [[ "$1" == '--' ]]; then shift; fi files=$@ } -- cgit v1.2.3-70-g09d2