aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-04-17 18:21:28 +0800
committertypebrook <typebrook@gmail.com>2020-04-17 18:21:28 +0800
commit2db6ef372e845063d28e2338470c98dd696eca68 (patch)
treea2510a5e2ddaac0ca647db17dfcf310d515d5a89
parentf10d3396e504166f95c9d015affe5ac884ed63fe (diff)
Add shorter argument '-n' for '--no-action'
-rwxr-xr-xgist4
1 files changed, 2 insertions, 2 deletions
diff --git a/gist b/gist
index c773d4f..087e1d8 100755
--- a/gist
+++ b/gist
@@ -13,7 +13,7 @@
13# 'all' or 'a' for both your and starred gists. Format for each line is: 13# 'all' or 'a' for both your and starred gists. Format for each line is:
14# <INDEX> <URL> <FILE_NUM> <COMMENT_NUM> <DESCRIPTION> 14# <INDEX> <URL> <FILE_NUM> <COMMENT_NUM> <DESCRIPTION>
15# fetch, f [star|s] Update the local list of your gists, 'star' for your starred gists 15# fetch, f [star|s] Update the local list of your gists, 'star' for your starred gists
16# <INDEX> [--no-action] Show the path of local gist repo and do custom actions(enter sub-shell by default) 16# <INDEX> [-n|--no-action] Show the path of local gist repo and do custom actions(enter sub-shell by default)
17# new, n [-d |--desc <description>] [-p] <FILE>... create a new gist with files 17# new, n [-d |--desc <description>] [-p] <FILE>... create a new gist with files
18# new, n [-d |--desc <description>] [-p] [-f|--file <FILE_NAME>] create a new gist from STDIN 18# new, n [-d |--desc <description>] [-p] [-f|--file <FILE_NAME>] create a new gist from STDIN
19# grep, g <PATTERN> Grep gists by description, filename and content with a given pattern 19# grep, g <PATTERN> Grep gists by description, filename and content with a given pattern
@@ -494,7 +494,7 @@ _goto_gist() {
494 echo "$folder/$GIST_ID" 494 echo "$folder/$GIST_ID"
495 touch "$folder/$GIST_ID" 495 touch "$folder/$GIST_ID"
496 496
497 if [[ $* =~ --no-action ]]; then 497 if [[ $* =~ (-n|--no-action) ]]; then
498 return 0 498 return 0
499 elif [[ -z $action ]]; then 499 elif [[ -z $action ]]; then
500 action='echo Inside subshell, press \<CTRL-D\> to exit; ${SHELL:-bash}' 500 action='echo Inside subshell, press \<CTRL-D\> to exit; ${SHELL:-bash}'