diff options
author | typebrook <typebrook@gmail.com> | 2020-04-17 18:21:28 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-04-17 18:21:28 +0800 |
commit | 2db6ef372e845063d28e2338470c98dd696eca68 (patch) | |
tree | a2510a5e2ddaac0ca647db17dfcf310d515d5a89 | |
parent | f10d3396e504166f95c9d015affe5ac884ed63fe (diff) |
Add shorter argument '-n' for '--no-action'
-rwxr-xr-x | gist | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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}' |