diff --git a/doc/ncdu.pod b/doc/ncdu.pod index f5fcc78f9d6cadf0f681c12050dc7e4450258030..e7619cdf1fdc67860ec37a70d6576cdbb17c428e 100644 --- a/doc/ncdu.pod +++ b/doc/ncdu.pod @@ -30,13 +30,13 @@ Quiet mode. While calculating disk space, ncdu will update the screen 10 times a second by default, this will be decreased to once every 2 seconds in quiet mode. Use this feature to save bandwidth over remote connections. -=item -u I<0,1,2> +=item -0, -1, -2 -Interface used to give feedback on scanning progress. C<0> will prevent any -output from being displayed before ncdu is done scanning, while C<1> will -display compact progress information on a single line of output. C<2> presents -a full-screen ncurses interface while scanning (the default). C<0> and C<1> do -not initialize ncurses before the directory has been scanned, while C<2> is the +Interface used to give feedback on scanning progress. C<-0> will prevent any +output from being displayed before ncdu is done scanning, while C<-1> will +display compact progress information on a single line of output. C<-2> presents +a full-screen ncurses interface while scanning (the default). C<-0> and C<-1> do +not initialize ncurses before the directory has been scanned, while C<-2> is the only interface that provides feedback on recoverable errors. This does not affect the interface used when re-scanning a directory from the ncurses browser, where the full ncurses interface is always used. diff --git a/src/main.c b/src/main.c index 64a530cd759b81bb3a6b230468409e45fa347139..3aed38059378725c4e0dab96fb447c359d831a0c 100644 --- a/src/main.c +++ b/src/main.c @@ -113,18 +113,11 @@ static void argv_parse(int argc, char **argv) { for(i=1; i<argc; i++) { if(argv[i][0] == '-') { /* flags requiring arguments */ - if(!strcmp(argv[i], "-X") || !strcmp(argv[i], "-u") || !strcmp(argv[i], "-o") || !strcmp(argv[i], "-f") + if(!strcmp(argv[i], "-X") || !strcmp(argv[i], "-o") || !strcmp(argv[i], "-f") || !strcmp(argv[i], "--exclude-from") || !strcmp(argv[i], "--exclude")) { if(i+1 >= argc) { printf("Option %s requires an argument\n", argv[i]); exit(1); - } else if(strcmp(argv[i], "-u") == 0) { - i++; - if(!(argv[i][0] == '0' || argv[i][0] == '1' || argv[i][0] == '2') || argv[i][1] != 0) { - printf("Option -u expects either 0, 1 or 2 as argument.\n"); - exit(1); - } - dir_ui = argv[i][0]-'0'; } else if(strcmp(argv[i], "-o") == 0) export = argv[++i]; else if(strcmp(argv[i], "-f") == 0) @@ -141,6 +134,9 @@ static void argv_parse(int argc, char **argv) { len = strlen(argv[i]); for(j=1; j<len; j++) switch(argv[i][j]) { + case '0': dir_ui = 0; break; + case '1': dir_ui = 1; break; + case '2': dir_ui = 2; break; case 'x': dir_scan_smfs = 1; break; case 'r': read_only = 1; break; case 'q': update_delay = 2000; break; @@ -154,7 +150,7 @@ static void argv_parse(int argc, char **argv) { printf(" -r Read only\n"); printf(" -o FILE Export scanned directory to FILE\n"); printf(" -f FILE Import scanned directory from FILE\n"); - printf(" -u <0-2> UI to use when scanning (0=minimal,2=verbose)\n"); + printf(" -0,-1,-2 UI to use when scanning (0=none,2=full ncurses)\n"); printf(" --exclude PATTERN Exclude files that match PATTERN\n"); printf(" -X, --exclude-from FILE Exclude files that match any pattern in FILE\n"); exit(0);