Re-format help

This commit is contained in:
Arun Prakash Jana 2017-07-03 09:46:37 +05:30
parent be8e4d8552
commit be8e9d5213
No known key found for this signature in database
GPG key ID: A75979F35C080412
4 changed files with 106 additions and 101 deletions

View file

@ -133,7 +133,8 @@ Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/i
#### Cmdline options #### Cmdline options
usage: nnn [-l] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH] usage: nnn [-c N] [-e] [-i] [-l] [n]
[-p nlay] [-S] [-v] [-h] [PATH]
The missing terminal file browser for X. The missing terminal file browser for X.
@ -146,7 +147,7 @@ Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/i
-i start in navigate-as-you-type mode -i start in navigate-as-you-type mode
-l start in light mode (fewer details) -l start in light mode (fewer details)
-n disable color for directory entries -n disable color for directory entries
-p path to custom nlay -p nlay path to custom nlay
-S start in disk usage analyzer mode -S start in disk usage analyzer mode
-v show program version and exit -v show program version and exit
-h show this help and exit -h show this help and exit
@ -158,14 +159,14 @@ Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/i
``` ```
Key | Function Key | Function
-+- -+-
Up, k, ^P | Previous entry , k, ^P | Previous entry
Down, j, ^N | Next entry , j, ^N | Next entry
PgUp, ^U | Scroll half page up PgUp, ^U | Scroll half page up
PgDn, ^D | Scroll half page down PgDn, ^D | Scroll half page down
Home, g, ^, ^A | Jump to first entry Home, g, ^, ^A | Jump to first entry
End, G, $, ^E | Jump to last entry End, G, $, ^E | Jump to last entry
Right, Enter, l, ^M | Open file or enter dir →, ↵, l, ^M | Open file or enter dir
Left, Bksp, h, ^H | Go to parent dir , Bksp, h, ^H | Go to parent dir
Insert | Toggle navigate-as-you-type mode Insert | Toggle navigate-as-you-type mode
~ | Jump to HOME dir ~ | Jump to HOME dir
& | Jump to initial dir & | Jump to initial dir
@ -187,7 +188,7 @@ Right, Enter, l, ^M | Open file or enter dir
o | Open dir in NNN_DE_FILE_MANAGER o | Open dir in NNN_DE_FILE_MANAGER
p | Open entry in PAGER (fallback less) p | Open entry in PAGER (fallback less)
^K | Invoke file path copier ^K | Invoke file path copier
^L, F2 | Force a redraw, exit filter prompt ^L, F2 | Force a redraw, unfilter
? | Toggle help and settings screen ? | Toggle help and settings screen
Q | Quit and change directory Q | Quit and change directory
q, ^Q | Quit q, ^Q | Quit

View file

@ -1,7 +1,4 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#define CWD "cwd: "
#define CURSR " > "
#define EMPTY " "
#define CONTROL(c) ((c) ^ 0x40) #define CONTROL(c) ((c) ^ 0x40)
/* Supported actions */ /* Supported actions */

13
nnn.1
View file

@ -6,9 +6,12 @@
.Nd the missing terminal file browser for X .Nd the missing terminal file browser for X
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Ar -l .Op Ar -c N
.Op Ar -e
.Op Ar -i .Op Ar -i
.Op Ar -p custom_nlay .Op Ar -l
.Op Ar -n
.Op Ar -p nlay
.Op Ar -S .Op Ar -S
.Op Ar -v .Op Ar -v
.Op Ar -h .Op Ar -h
@ -64,7 +67,7 @@ Show change dir prompt
.It Ic d .It Ic d
Toggle detail view Toggle detail view
.It Ic D .It Ic D
Toggle current file details screen Show current file details screen
.It Ic m .It Ic m
Show concise media info Show concise media info
.It Ic M .It Ic M
@ -86,7 +89,7 @@ Open current entry in PAGER (fallback less)
.It Ic ^K .It Ic ^K
Invoke file path copier Invoke file path copier
.It Ic ^L, [F2] .It Ic ^L, [F2]
Force a redraw, exit filter prompt Force a redraw, unfilter
.It Ic \&? .It Ic \&?
Toggle help and settings screen Toggle help and settings screen
.It Ic Q .It Ic Q
@ -117,7 +120,7 @@ supports the following options:
.Fl n .Fl n
disable color for directory entries disable color for directory entries
.Pp .Pp
.Fl "p custom_nlay" .Fl "p nlay"
path to custom nlay path to custom nlay
.Pp .Pp
.Fl S .Fl S

22
nnn.c
View file

@ -104,6 +104,9 @@ disabledbg()
#define TOUPPER(ch) \ #define TOUPPER(ch) \
(((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch)) (((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch))
#define MAX_CMD_LEN 5120 #define MAX_CMD_LEN 5120
#define CWD "cwd: "
#define CURSR " > "
#define EMPTY " "
#define CURSYM(flag) (flag ? CURSR : EMPTY) #define CURSYM(flag) (flag ? CURSR : EMPTY)
#define FILTER '/' #define FILTER '/'
#define MAX_BM 10 #define MAX_BM 10
@ -1463,14 +1466,14 @@ show_help(void)
static char helpstr[] = ("\ static char helpstr[] = ("\
Key | Function\n\ Key | Function\n\
-+-\n\ -+-\n\
Up, k, ^P | Previous entry\n\ , k, ^P | Previous entry\n\
Down, j, ^N | Next entry\n\ , j, ^N | Next entry\n\
PgUp, ^U | Scroll half page up\n\ PgUp, ^U | Scroll half page up\n\
PgDn, ^D | Scroll half page down\n\ PgDn, ^D | Scroll half page down\n\
Home, g, ^, ^A | Jump to first entry\n\ Home, g, ^, ^A | Jump to first entry\n\
End, G, $, ^E | Jump to last entry\n\ End, G, $, ^E | Jump to last entry\n\
Right, Enter, l, ^M | Open file or enter dir\n\ , , l, ^M | Open file or enter dir\n\
Left, Bksp, h, ^H | Go to parent dir\n\ , Bksp, h, ^H | Go to parent dir\n\
Insert | Toggle navigate-as-you-type mode\n\ Insert | Toggle navigate-as-you-type mode\n\
~ | Jump to HOME dir\n\ ~ | Jump to HOME dir\n\
& | Jump to initial dir\n\ & | Jump to initial dir\n\
@ -1481,7 +1484,7 @@ show_help(void)
b | Show bookmark key prompt\n\ b | Show bookmark key prompt\n\
c | Show change dir prompt\n\ c | Show change dir prompt\n\
d | Toggle detail view\n\ d | Toggle detail view\n\
D | Toggle current file details screen\n\ D | Show current file details screen\n\
m | Show concise media info\n\ m | Show concise media info\n\
M | Show full media info\n\ M | Show full media info\n\
s | Toggle sort by file size\n\ s | Toggle sort by file size\n\
@ -1492,7 +1495,7 @@ show_help(void)
o | Open dir in NNN_DE_FILE_MANAGER\n\ o | Open dir in NNN_DE_FILE_MANAGER\n\
p | Open entry in PAGER (fallback less)\n\ p | Open entry in PAGER (fallback less)\n\
^K | Invoke file path copier\n\ ^K | Invoke file path copier\n\
^L, F2 | Force a redraw, exit filter prompt\n\ ^L, F2 | Force a redraw, unfilter\n\
? | Toggle help and settings screen\n\ ? | Toggle help and settings screen\n\
Q | Quit and change directory\n\ Q | Quit and change directory\n\
q, ^Q | Quit\n\n\n"); q, ^Q | Quit\n\n\n");
@ -1508,7 +1511,7 @@ show_help(void)
dprintf(fd, "BOOKMARKS\n"); dprintf(fd, "BOOKMARKS\n");
for (; i < MAX_BM; ++i) for (; i < MAX_BM; ++i)
if (bookmark[i].key) if (bookmark[i].key)
dprintf(fd, " %s: %s\n", dprintf(fd, "\t%s: %s\n",
bookmark[i].key, bookmark[i].loc); bookmark[i].key, bookmark[i].loc);
else else
break; break;
@ -2452,7 +2455,8 @@ nochange:
static void static void
usage(void) usage(void)
{ {
printf("usage: nnn [-l] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]\n\n\ printf("usage: nnn [-c N] [-e] [-i] [-l] [n]\n\
[-p nlay] [-S] [-v] [-h] [PATH]\n\n\
The missing terminal file browser for X.\n\n\ The missing terminal file browser for X.\n\n\
positional arguments:\n\ positional arguments:\n\
PATH directory to open [default: current dir]\n\n\ PATH directory to open [default: current dir]\n\n\
@ -2462,7 +2466,7 @@ optional arguments:\n\
-i start in navigate-as-you-type mode\n\ -i start in navigate-as-you-type mode\n\
-l start in light mode (fewer details)\n\ -l start in light mode (fewer details)\n\
-n disable color for directory entries\n\ -n disable color for directory entries\n\
-p path to custom nlay\n\ -p nlay path to custom nlay\n\
-S start in disk usage analyzer mode\n\ -S start in disk usage analyzer mode\n\
-v show program version and exit\n\ -v show program version and exit\n\
-h show this help and exit\n\n\ -h show this help and exit\n\n\