Light mode as default, options changed

-d is to show detail mode
-H is to show hidden files
-l is retired
This commit is contained in:
Arun Prakash Jana 2019-08-04 09:55:14 +05:30
parent cf1b9d34ea
commit 9fdfd9388d
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 20 additions and 20 deletions

View file

@ -242,7 +242,7 @@ Option completion scripts for Bash, Fish and Zsh can be found in respective subd
#### Cmdline options #### Cmdline options
``` ```
usage: nnn [-b key] [-d] [-e] [-i] [-l] [-n] usage: nnn [-b key] [-d] [-e] [-H] [-i] [-n]
[-p file] [-s] [-S] [-v] [-w] [-h] [PATH] [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]
The missing terminal file manager for X. The missing terminal file manager for X.
@ -252,10 +252,10 @@ positional args:
optional args: optional args:
-b key open bookmark key -b key open bookmark key
-d show hidden files -d detail mode
-e use exiftool for media info -e use exiftool for media info
-H show hidden files
-i nav-as-you-type mode -i nav-as-you-type mode
-l light mode
-n version sort -n version sort
-p file selection file (stdout if '-') -p file selection file (stdout if '-')
-s string filters [default: regex] -s string filters [default: regex]

10
nnn.1
View file

@ -9,8 +9,8 @@
.Op Ar -b key .Op Ar -b key
.Op Ar -d .Op Ar -d
.Op Ar -e .Op Ar -e
.Op Ar -H
.Op Ar -i .Op Ar -i
.Op Ar -l
.Op Ar -n .Op Ar -n
.Op Ar -p file .Op Ar -p file
.Op Ar -s .Op Ar -s
@ -41,17 +41,17 @@ supports the following options:
specify bookmark key to open specify bookmark key to open
.Pp .Pp
.Fl d .Fl d
show hidden files detail mode
.Pp .Pp
.Fl e .Fl e
use exiftool instead of mediainfo use exiftool instead of mediainfo
.Pp .Pp
.Fl H
show hidden files
.Pp
.Fl i .Fl i
start in navigate-as-you-type mode start in navigate-as-you-type mode
.Pp .Pp
.Fl l
start in light mode (fewer details)
.Pp
.Fl n .Fl n
use case-insensitive version compare to sort files use case-insensitive version compare to sort files
.Pp .Pp

View file

@ -254,7 +254,7 @@ static settings cfg = {
0, /* extnorder */ 0, /* extnorder */
0, /* showhidden */ 0, /* showhidden */
0, /* copymode */ 0, /* copymode */
1, /* showdetail */ 0, /* showdetail */
1, /* ctxactive */ 1, /* ctxactive */
0, /* reserved */ 0, /* reserved */
0, /* curctx */ 0, /* curctx */
@ -2417,7 +2417,7 @@ static void printent_long(const struct entry *ent, int sel, uint namecols)
attroff(A_REVERSE); attroff(A_REVERSE);
} }
static void (*printptr)(const struct entry *ent, int sel, uint namecols) = &printent_long; static void (*printptr)(const struct entry *ent, int sel, uint namecols) = &printent;
static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */) static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */)
{ {
@ -4504,17 +4504,17 @@ nochange:
static void usage(void) static void usage(void)
{ {
fprintf(stdout, fprintf(stdout,
"%s: nnn [-b key] [-d] [-e] [-i] [-l] [-n]\n" "%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n]\n"
" [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]\n\n" " [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]\n\n"
"The missing terminal file manager for X.\n\n" "The missing terminal file manager for X.\n\n"
"positional args:\n" "positional args:\n"
" PATH start dir [default: current dir]\n\n" " PATH start dir [default: current dir]\n\n"
"optional args:\n" "optional args:\n"
" -b key open bookmark key\n" " -b key open bookmark key\n"
" -d show hidden files\n" " -d detail mode\n"
" -e use exiftool for media info\n" " -e use exiftool for media info\n"
" -H show hidden files\n"
" -i nav-as-you-type mode\n" " -i nav-as-you-type mode\n"
" -l light mode\n"
" -n version sort\n" " -n version sort\n"
" -p file selection file (stdout if '-')\n" " -p file selection file (stdout if '-')\n"
" -s string filters [default: regex]\n" " -s string filters [default: regex]\n"
@ -4649,16 +4649,16 @@ int main(int argc, char *argv[])
char *arg = NULL; char *arg = NULL;
int opt; int opt;
while ((opt = getopt(argc, argv, "Slib:denp:svwh")) != -1) { while ((opt = getopt(argc, argv, "HSib:denp:svwh")) != -1) {
switch (opt) { switch (opt) {
case 'S': case 'S':
cfg.blkorder = 1; cfg.blkorder = 1;
nftw_fn = sum_bsizes; nftw_fn = sum_bsizes;
BLK_SHIFT = ffs(S_BLKSIZE) - 1; BLK_SHIFT = ffs(S_BLKSIZE) - 1;
break; break;
case 'l': case 'd':
cfg.showdetail = 0; cfg.showdetail = 1;
printptr = &printent; printptr = &printent_long;
break; break;
case 'i': case 'i':
cfg.filtermode = 1; cfg.filtermode = 1;
@ -4666,12 +4666,12 @@ int main(int argc, char *argv[])
case 'b': case 'b':
arg = optarg; arg = optarg;
break; break;
case 'd':
cfg.showhidden = 1;
break;
case 'e': case 'e':
cfg.metaviewer = EXIFTOOL; cfg.metaviewer = EXIFTOOL;
break; break;
case 'H':
cfg.showhidden = 1;
break;
case 'n': case 'n':
cmpfn = &xstrverscasecmp; cmpfn = &xstrverscasecmp;
break; break;