diff options
author | Jim Meyering <jim@meyering.net> | 1993-10-19 00:00:06 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-10-19 00:00:06 +0000 |
commit | 723d3d528db8b3abb05357bf5a7af7173c1636e7 (patch) | |
tree | 23fc7ea7e6b0721e7705f60a7c14bd9dcafd5eca /src/du.c | |
parent | 712ac6d5a0122dbcbc89669143580de1326f1d46 (diff) | |
download | coreutils-723d3d528db8b3abb05357bf5a7af7173c1636e7.tar.xz |
merge with 3.8.4k
Diffstat (limited to 'src/du.c')
-rw-r--r-- | src/du.c | 30 |
1 files changed, 13 insertions, 17 deletions
@@ -191,21 +191,21 @@ static struct option const long_options[] = }; static void -usage (reason, status) - char *reason; +usage (status, reason) int status; + char *reason; { if (reason != NULL) fprintf (status == 0 ? stdout : stderr, "%s: %s\n", program_name, reason); - fprintf (status == 0 ? stdout : stderr, "\ -Usage: %s [OPTION]... [PATH]...\n\ -", - program_name); - - if (status == 0) - printf ("\ + if (status != 0) + fprintf (stderr, "Try `%s --help' for more information.\n", + program_name); + else + { + printf ("Usage: %s [OPTION]... [PATH]...\n", program_name); + printf ("\ \n\ -a, --all write counts for all files, not just directories\n\ -b, --bytes print size in bytes\n\ @@ -219,11 +219,7 @@ Usage: %s [OPTION]... [PATH]...\n\ -S, --separate-dirs do not include size of subdirectories\n\ --help display this help and exit\n\ --version output version information and exit\n"); - - else - fprintf (stderr, "Try `%s --help' for more information.\n", - program_name); - + } exit (status); } @@ -287,7 +283,7 @@ main (argc, argv) break; default: - usage ((char *) 0, 2); + usage (2, (char *) 0); } } @@ -298,10 +294,10 @@ main (argc, argv) } if (show_help) - usage (NULL, 0); + usage (0, NULL); if (opt_all && opt_summarize_only) - usage ("cannot both summarize and show all entries", 2); + usage (2, "cannot both summarize and show all entries"); /* Initialize the hash structure for inode numbers. */ hash_init (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE); |