diff options
author | 2019-03-11 20:21:41 +0530 | |
---|---|---|
committer | 2019-03-11 20:21:41 +0530 | |
commit | 2e07a20d23170e38f57ad101abe2467534baf914 (patch) | |
tree | 4cba8bb0ac149b89c84a357c3d0366daa2797d41 /src | |
parent | 8882aa802286a98287f066cc316bd6f17bf58b81 (diff) | |
download | nnn-2e07a20d23170e38f57ad101abe2467534baf914.tar.gz |
Option `-d` to show hidden files.
NNN_SHOW_HIDDEN is removed.
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -454,13 +454,12 @@ static const char * const messages[] = { #define NNN_TMPFILE 7 #define NNNLVL 8 /* strings end here */ #define NNN_USE_EDITOR 9 /* flags begin here */ -#define NNN_SHOW_HIDDEN 10 -#define NNN_NO_AUTOSELECT 11 -#define NNN_RESTRICT_NAV_OPEN 12 -#define NNN_RESTRICT_0B 13 -#define NNN_TRASH 14 +#define NNN_NO_AUTOSELECT 10 +#define NNN_RESTRICT_NAV_OPEN 11 +#define NNN_RESTRICT_0B 12 +#define NNN_TRASH 13 #ifdef __linux__ -#define NNN_OPS_PROG 15 +#define NNN_OPS_PROG 14 #endif static const char * const env_cfg[] = { @@ -474,7 +473,6 @@ static const char * const env_cfg[] = { "NNN_TMPFILE", "NNNLVL", "NNN_USE_EDITOR", - "NNN_SHOW_HIDDEN", "NNN_NO_AUTOSELECT", "NNN_RESTRICT_NAV_OPEN", "NNN_RESTRICT_0B", @@ -3967,13 +3965,14 @@ nochange: static void usage(void) { fprintf(stdout, - "%s: nnn [-b key] [-C] [-e] [-i] [-l] [-n]\n" + "%s: nnn [-b key] [-C] [-d] [-e] [-i] [-l] [-n]\n" " [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]\n\n" "The missing terminal file manager for X.\n\n" "positional args:\n" " PATH start dir [default: current dir]\n\n" "optional args:\n" " -b key open bookmark key\n" + " -d show hidden files\n" " -C disable directory color\n" " -e use exiftool for media info\n" " -i nav-as-you-type mode\n" @@ -3994,7 +3993,7 @@ int main(int argc, char *argv[]) char *ipath = NULL; int opt; - while ((opt = getopt(argc, argv, "Slib:enp:svwh")) != -1) { + while ((opt = getopt(argc, argv, "Slib:denp:svwh")) != -1) { switch (opt) { case 'S': cfg.blkorder = 1; @@ -4011,6 +4010,9 @@ int main(int argc, char *argv[]) case 'b': ipath = optarg; break; + case 'd': + cfg.showhidden = 1; + break; case 'e': cfg.metaviewer = EXIFTOOL; break; @@ -4102,9 +4104,6 @@ int main(int argc, char *argv[]) /* Increase current open file descriptor limit */ open_max = max_openfds(); - if (getuid() == 0 || getenv(env_cfg[NNN_SHOW_HIDDEN])) - cfg.showhidden = 1; - /* Edit text in EDITOR, if opted */ if (getenv(env_cfg[NNN_USE_EDITOR])) cfg.useeditor = 1; |