From 2db6ef372e845063d28e2338470c98dd696eca68 Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 17 Apr 2020 18:21:28 +0800 Subject: Add shorter argument '-n' for '--no-action' --- gist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gist b/gist index c773d4f..087e1d8 100755 --- a/gist +++ b/gist @@ -13,7 +13,7 @@ # 'all' or 'a' for both your and starred gists. Format for each line is: # # fetch, f [star|s] Update the local list of your gists, 'star' for your starred gists -# [--no-action] Show the path of local gist repo and do custom actions(enter sub-shell by default) +# [-n|--no-action] Show the path of local gist repo and do custom actions(enter sub-shell by default) # new, n [-d |--desc ] [-p] ... create a new gist with files # new, n [-d |--desc ] [-p] [-f|--file ] create a new gist from STDIN # grep, g Grep gists by description, filename and content with a given pattern @@ -494,7 +494,7 @@ _goto_gist() { echo "$folder/$GIST_ID" touch "$folder/$GIST_ID" - if [[ $* =~ --no-action ]]; then + if [[ $* =~ (-n|--no-action) ]]; then return 0 elif [[ -z $action ]]; then action='echo Inside subshell, press \ to exit; ${SHELL:-bash}' -- cgit v1.2.3-70-g09d2