diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2017-06-30 05:27:25 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-06-30 05:27:25 +0530 |
commit | 5619ef443661a6ff586e20593dd396a7f416eab3 (patch) | |
tree | a0b8dc5f4152038c6f62bcf0eb12b0660a5f003b | |
parent | 04b9e8ec7734d31c32cc46612cc677df0cda0c0f (diff) | |
download | nnn-5619ef443661a6ff586e20593dd396a7f416eab3.tar.gz |
Simplify argument handling
-rw-r--r-- | misc/quitcd/quitcd.bash | 6 | ||||
-rw-r--r-- | misc/quitcd/quitcd.fish | 2 | ||||
-rw-r--r-- | misc/quitcd/quitcd.zsh | 6 |
3 files changed, 3 insertions, 11 deletions
diff --git a/misc/quitcd/quitcd.bash b/misc/quitcd/quitcd.bash index 5248036..dc83b23 100644 --- a/misc/quitcd/quitcd.bash +++ b/misc/quitcd/quitcd.bash @@ -2,11 +2,7 @@ export NNN_TMPFILE="/tmp/nnn" n() { - if [ -n "$1" ]; then - nnn "$1" - else - nnn - fi + nnn "$@" if [ -f $NNN_TMPFILE ]; then . $NNN_TMPFILE diff --git a/misc/quitcd/quitcd.fish b/misc/quitcd/quitcd.fish index 59a7f1b..079f33e 100644 --- a/misc/quitcd/quitcd.fish +++ b/misc/quitcd/quitcd.fish @@ -1,7 +1,7 @@ export NNN_TMPFILE="/tmp/nnn" function n --description 'support nnn quit and change directory' - nnn $argv[1] + nnn $argv if test -e $NNN_TMPFILE . $NNN_TMPFILE diff --git a/misc/quitcd/quitcd.zsh b/misc/quitcd/quitcd.zsh index 5248036..dc83b23 100644 --- a/misc/quitcd/quitcd.zsh +++ b/misc/quitcd/quitcd.zsh @@ -2,11 +2,7 @@ export NNN_TMPFILE="/tmp/nnn" n() { - if [ -n "$1" ]; then - nnn "$1" - else - nnn - fi + nnn "$@" if [ -f $NNN_TMPFILE ]; then . $NNN_TMPFILE |