mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Simplify argument handling
This commit is contained in:
parent
04b9e8ec77
commit
5619ef4436
|
@ -2,11 +2,7 @@ export NNN_TMPFILE="/tmp/nnn"
|
||||||
|
|
||||||
n()
|
n()
|
||||||
{
|
{
|
||||||
if [ -n "$1" ]; then
|
nnn "$@"
|
||||||
nnn "$1"
|
|
||||||
else
|
|
||||||
nnn
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f $NNN_TMPFILE ]; then
|
if [ -f $NNN_TMPFILE ]; then
|
||||||
. $NNN_TMPFILE
|
. $NNN_TMPFILE
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export NNN_TMPFILE="/tmp/nnn"
|
export NNN_TMPFILE="/tmp/nnn"
|
||||||
|
|
||||||
function n --description 'support nnn quit and change directory'
|
function n --description 'support nnn quit and change directory'
|
||||||
nnn $argv[1]
|
nnn $argv
|
||||||
|
|
||||||
if test -e $NNN_TMPFILE
|
if test -e $NNN_TMPFILE
|
||||||
. $NNN_TMPFILE
|
. $NNN_TMPFILE
|
||||||
|
|
|
@ -2,11 +2,7 @@ export NNN_TMPFILE="/tmp/nnn"
|
||||||
|
|
||||||
n()
|
n()
|
||||||
{
|
{
|
||||||
if [ -n "$1" ]; then
|
nnn "$@"
|
||||||
nnn "$1"
|
|
||||||
else
|
|
||||||
nnn
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f $NNN_TMPFILE ]; then
|
if [ -f $NNN_TMPFILE ]; then
|
||||||
. $NNN_TMPFILE
|
. $NNN_TMPFILE
|
||||||
|
|
Loading…
Reference in a new issue