aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-14 16:50:16 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-14 16:51:27 +0530
commit971895e8736553e6f86a788776079459018201f8 (patch)
treee00bf5fd62bd4ed1a03078742286f7b134caf40d
parentd2082b44dc565c2faa299734e9249cb858b5def0 (diff)
downloadnnn-971895e8736553e6f86a788776079459018201f8.tar.gz
Option -S: start in disk usage analyzer mode
-rw-r--r--README.md7
-rw-r--r--nnn.15
-rw-r--r--nnn.c6
3 files changed, 12 insertions, 6 deletions
diff --git a/README.md b/README.md
index a3d1159..e9ec9bc 100644
--- a/README.md
+++ b/README.md
@@ -162,11 +162,12 @@ Add the following to your shell's rc file for the best experience:
### Usage
-Start nnn (default: current directory):
+Start nnn (default dir: current directory):
- $ nnn [-d] [-v] [path_to_dir]
+ $ nnn [-d] [-S] [-v] [dir]
- -d: open in detail view mode
+ -d: start in detail view mode
+ -S: start in disk usage analyzer mode
-v: show version and exit
`>` indicates the currently selected entry in nnn.
diff --git a/nnn.1 b/nnn.1
index c7a71e8..23352db 100644
--- a/nnn.1
+++ b/nnn.1
@@ -85,7 +85,10 @@ directory you came out of.
supports the following options:
.Pp
.Fl d
- open in detail view mode
+ start in detail view mode
+.Pp
+.Fl S
+ start in disk usage analyzer mode
.Pp
.Fl v
show version and exit
diff --git a/nnn.c b/nnn.c
index 9c8c060..fdbae30 100644
--- a/nnn.c
+++ b/nnn.c
@@ -1578,7 +1578,7 @@ nochange:
static void
usage(void)
{
- fprintf(stderr, "usage: nnn [-d] [-v] [dir]\n");
+ fprintf(stderr, "usage: nnn [-d] [-S] [-v] [dir]\n");
exit(1);
}
@@ -1598,8 +1598,10 @@ main(int argc, char *argv[])
if (argc > 3)
usage();
- while ((opt = getopt(argc, argv, "dv")) != -1) {
+ while ((opt = getopt(argc, argv, "dSv")) != -1) {
switch (opt) {
+ case 'S':
+ bsizeorder = 1;
case 'd':
/* Open in detail mode, if set */
showdetail = 1;