diff options
author | yorhel <yorhel@ce56bc8d-f834-0410-b703-f827bd498a76> | 2008-09-10 15:14:12 +0000 |
---|---|---|
committer | yorhel <yorhel@ce56bc8d-f834-0410-b703-f827bd498a76> | 2008-09-10 15:14:12 +0000 |
commit | 04b70328464f162493530a2a3fcedb53d4f6a45e (patch) | |
tree | 5f8928d287df7c8db7e4f6152173ca1c5cb48400 /src/main.c | |
parent | 02a94d79e8b013144ee4e51ae2bf958a5b8e9d14 (diff) |
Decided to get rid of that startup window...v1.4
git-svn-id: svn://blicky.net/ncdu/trunk@40 ce56bc8d-f834-0410-b703-f827bd498a76
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 28 |
1 files changed, 8 insertions, 20 deletions
@@ -70,7 +70,7 @@ void parseCli(int argc, char **argv) { case 'q': sdelay = 2000; break; case '?': case 'h': - printf("ncdu [-hqvx] [--exclude PATTERN] [-X FILE] [dir]\n\n"); + printf("ncdu [-hqvx] [--exclude PATTERN] [-X FILE] directory\n\n"); printf(" -h This help message\n"); printf(" -q Quiet mode, refresh interval 2 seconds\n"); printf(" -v Print version\n"); @@ -82,7 +82,7 @@ void parseCli(int argc, char **argv) { printf("ncdu %s\n", PACKAGE_VERSION); exit(0); default: - printf("Unknown option: -%c\n", argv[i][j]); + printf("Unknown option: -%c\nSee '%s -h' for more information.\n", argv[i][j], argv[0]); exit(1); } } else { @@ -92,15 +92,10 @@ void parseCli(int argc, char **argv) { sdir[0] = 0; } } -} - - -struct dir *loadDir(char *path) { - struct stat st; - - if(stat(path, &st) < 0) - return(showCalc(path)); - return(showCalc(path)); + if(!sdir[0]) { + printf("Please specify a directory.\nSee '%s -h' for more information.\n", argv[0]); + exit(1); + } } @@ -117,16 +112,9 @@ int main(int argc, char **argv) { keypad(stdscr, TRUE); ncresize(); - if(!sdir[0] && settingsWin()) - goto mainend; - - while((dat = loadDir(sdir)) == NULL) - if(settingsWin()) - goto mainend; - - showBrowser(); + if((dat = showCalc(sdir)) != NULL) + showBrowser(); - mainend: erase(); refresh(); endwin(); |