diff options
| author | Jim Meyering <jim@meyering.net> | 1993-10-17 03:57:04 +0000 |
|---|---|---|
| committer | Jim Meyering <jim@meyering.net> | 1993-10-17 03:57:04 +0000 |
| commit | fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8 (patch) | |
| tree | ffc67e10bcf805a9ee5b8243a5103f5bdb4fb90a /src/uname.c | |
| parent | merge with 1.8b (diff) | |
| download | coreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.gz coreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.zip | |
merge with 1.8.1g
Diffstat (limited to 'src/uname.c')
| -rw-r--r-- | src/uname.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/uname.c b/src/uname.c index 236e0d557..5d5ab0f3f 100644 --- a/src/uname.c +++ b/src/uname.c @@ -137,7 +137,7 @@ main (argc, argv) break; default: - usage (); + usage (1); } } @@ -148,10 +148,10 @@ main (argc, argv) } if (show_help) - usage (); + usage (0); if (optind != argc) - usage (); + usage (1); if (toprint == 0) toprint = PRINT_SYSNAME; @@ -185,10 +185,32 @@ print_element (mask, element) } static void -usage () +usage (status) + int status; { - fprintf (stderr, "\ -Usage: %s [-snrvma] [--sysname] [--nodename] [--release] [--version]\n\ - [--machine] [--all]\n", program_name); - exit (1); + fprintf (status == 0 ? stdout : stderr, "\ +Usage: %s [OPTION]...\n\ +", + program_name); + + if (status != 0) + fprintf (stderr, "\nTry `%s --help' for more information.\n", + program_name); + else + + printf ("\ +\n\ + -a, --all print all information\n\ + -m, --machine print the machine (hardware) type\n\ + -n, --nodename print the machine's network node hostname\n\ + -r, --release print the operating system release\n\ + -s, --sysname print the operating system name\n\ + -v print the operating system version\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +\n\ +Without any OPTION, assume -s.\n\ +"); + + exit (status); } |
