Use option -A to disable dir auto-select

This commit is contained in:
Arun Prakash Jana 2020-01-09 03:34:10 +05:30
parent 0492fa385d
commit 7bf7894022
No known key found for this signature in database
GPG key ID: A75979F35C080412
5 changed files with 12 additions and 11 deletions

View file

@ -13,6 +13,7 @@ _nnn ()
local -a opts
opts=(
-a
-A
-b
-c
-d
@ -28,7 +29,6 @@ _nnn ()
-R
-s
-S
-t
-v
-V
-x

View file

@ -12,6 +12,7 @@ else
end
complete -c nnn -s a -d 'use access time'
complete -c nnn -s A -d 'disable dir auto-select'
complete -c nnn -s b -r -d 'bookmark key to open' -x -a '(echo $NNN_BMS | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
complete -c nnn -s c -d 'cli-only opener'
complete -c nnn -s d -d 'start in detail mode'
@ -27,7 +28,6 @@ complete -c nnn -s r -d 'show cp, mv progress (Linux-only)'
complete -c nnn -s R -d 'disable rollover at edges'
complete -c nnn -s s -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
complete -c nnn -s S -d 'start in disk usage analyzer mode'
complete -c nnn -s t -d 'disable dir auto-select'
complete -c nnn -s v -d 'use version compare to sort files'
complete -c nnn -s V -d 'show program version and exit'
complete -c nnn -s x -d 'notis, sel to system clipboard'

View file

@ -10,6 +10,7 @@ setopt localoptions noshwordsplit noksharrays
local -a args
args=(
'(-a)-a[use access time]'
'(-A)-A[disable dir auto-select]'
'(-b)-b[bookmark key to open]:key char'
'(-c)-c[cli-only opener]'
'(-d)-d[start in detail mode]'
@ -25,7 +26,6 @@ args=(
'(-R)-R[disable rollover at edges]'
'(-s)-s[load session]:session name'
'(-S)-S[start in disk usage analyzer mode]'
'(-t)-t[disable dir auto-select]'
'(-v)-v[use version compare to sort files]'
'(-V)-V[show program version and exit]'
'(-x)-x[notis, sel to system clipboard]'

7
nnn.1
View file

@ -7,6 +7,7 @@
.Sh SYNOPSIS
.Nm
.Op Ar -a
.Op Ar -A
.Op Ar -b key
.Op Ar -c
.Op Ar -d
@ -47,6 +48,9 @@ supports the following options:
.Fl a
use access time for all operations (default: modification time)
.Pp
.Fl A
disable directory auto-select in navigate-as-you-type mode
.Pp
.Fl "b key"
specify bookmark key to open
.Pp
@ -92,9 +96,6 @@ supports the following options:
.Fl S
start in disk usage analyzer mode
.Pp
.Fl t
disable directory auto-select in navigate-as-you-type mode
.Pp
.Fl v
use case-insensitive version compare to sort files
.Pp

View file

@ -5506,6 +5506,7 @@ static void usage(void)
" PATH start dir [default: .]\n\n"
"optional args:\n"
" -a use access time\n"
" -A no dir auto-select\n"
" -b key open bookmark key\n"
" -c cli-only opener\n"
" -d detail mode\n"
@ -5521,7 +5522,6 @@ static void usage(void)
" -R no rollover at edges\n"
" -s name load session by name\n"
" -S du mode\n"
" -t no dir auto-select\n"
" -v version sort\n"
" -V show version\n"
" -x notis, sel to system clipboard\n"
@ -5667,7 +5667,7 @@ int main(int argc, char *argv[])
bool progress = FALSE;
#endif
while ((opt = getopt(argc, argv, "HSKab:cdEgnop:QrRs:tvVxh")) != -1) {
while ((opt = getopt(argc, argv, "HSKaAb:cdEgnop:QrRs:vVxh")) != -1) {
switch (opt) {
case 'S':
cfg.blkorder = 1;
@ -5680,6 +5680,9 @@ int main(int argc, char *argv[])
case 'a':
cfg.mtime = 0;
break;
case 'A':
cfg.autoselect = 0;
break;
case 'b':
arg = optarg;
break;
@ -5733,9 +5736,6 @@ int main(int argc, char *argv[])
case 's':
session = optarg;
break;
case 't':
cfg.autoselect = 0;
break;
case 'K':
check_key_collision();
return _SUCCESS;