mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Shorten env vars
This commit is contained in:
parent
6c2dc7fc95
commit
4d01aa78ae
12
nnn.1
12
nnn.1
|
@ -298,23 +298,23 @@ used. A single combination of arguments is supported for SHELL and PAGER.
|
|||
----------------------------------- + -------------------------------------------------
|
||||
.Ed
|
||||
.Pp
|
||||
\fBNNN_CONTEXT_COLORS:\fR string of color codes for each context, e.g.:
|
||||
\fBNNN_COLORS:\fR string of color codes for each context, e.g.:
|
||||
.Bd -literal
|
||||
export NNN_CONTEXT_COLORS='1234'
|
||||
export NNN_COLORS='1234'
|
||||
|
||||
codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
|
||||
.Ed
|
||||
.Pp
|
||||
\fBNNN_SSHFS_OPTS:\fR pass additional options to sshfs command:
|
||||
\fBNNN_SSHFS:\fR pass additional options to sshfs command:
|
||||
.Bd -literal
|
||||
export NNN_SSHFS_OPTS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
|
||||
export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
|
||||
|
||||
NOTE: The options must be preceded by `sshfs` and comma-separated without any space between them.
|
||||
.Ed
|
||||
.Pp
|
||||
\fBNNN_RCLONE_OPTS:\fR pass additional options to rclone command:
|
||||
\fBNNN_RCLONE:\fR pass additional options to rclone command:
|
||||
.Bd -literal
|
||||
export NNN_RCLONE_OPTS='rclone mount --read-only --no-checksum'
|
||||
export NNN_RCLONE='rclone mount --read-only --no-checksum'
|
||||
|
||||
NOTE: The options must be preceded by `rclone` and max 5 flags are supported.
|
||||
.Ed
|
||||
|
|
10
src/nnn.c
10
src/nnn.c
|
@ -521,7 +521,7 @@ static const char * const messages[] = {
|
|||
#define NNN_BMS 0
|
||||
#define NNN_PLUG 1
|
||||
#define NNN_OPENER 2
|
||||
#define NNN_CONTEXT_COLORS 3
|
||||
#define NNN_COLORS 3
|
||||
#define NNNLVL 4
|
||||
#define NNN_PIPE 5
|
||||
#define NNN_ARCHIVE 6 /* strings end here */
|
||||
|
@ -531,7 +531,7 @@ static const char * const env_cfg[] = {
|
|||
"NNN_BMS",
|
||||
"NNN_PLUG",
|
||||
"NNN_OPENER",
|
||||
"NNN_CONTEXT_COLORS",
|
||||
"NNN_COLORS",
|
||||
"NNNLVL",
|
||||
"NNN_PIPE",
|
||||
"NNN_ARCHIVE",
|
||||
|
@ -1213,7 +1213,7 @@ static bool selsafe(void)
|
|||
static bool initcurses(mmask_t *oldmask)
|
||||
{
|
||||
short i;
|
||||
char *colors = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444");
|
||||
char *colors = xgetenv(env_cfg[NNN_COLORS], "4444");
|
||||
|
||||
if (cfg.picker) {
|
||||
if (!newterm(NULL, stderr, stdin)) {
|
||||
|
@ -3489,11 +3489,11 @@ static bool remote_mount(char *newpath, int *presel)
|
|||
|
||||
if (opt == 's') {
|
||||
cmd = utils[UTIL_SSHFS];
|
||||
env = xgetenv("NNN_SSHFS_OPTS", cmd);
|
||||
env = xgetenv("NNN_SSHFS", cmd);
|
||||
} else if (opt == 'r') {
|
||||
flag |= F_NOWAIT;
|
||||
cmd = utils[UTIL_RCLONE];
|
||||
env = xgetenv("NNN_RCLONE_OPTS", "rclone mount");
|
||||
env = xgetenv("NNN_RCLONE", "rclone mount");
|
||||
} else {
|
||||
printwait(messages[MSG_INVALID_KEY], presel);
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue