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/env.c | |
parent | 6e1a4cca6862fa1fb40b4c38b73fa30ebb61344b (diff) | |
download | coreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.gz coreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.bz2 coreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.zip |
merge with 1.8.1g
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 31 |
1 files changed, 24 insertions, 7 deletions
@@ -145,7 +145,7 @@ main (argc, argv, envp) case 'u': break; default: - usage (); + usage (2); } } @@ -156,7 +156,7 @@ main (argc, argv, envp) } if (show_help) - usage (); + usage (0); if (optind != argc && !strcmp (argv[optind], "-")) ignore_environment = 1; @@ -192,11 +192,28 @@ main (argc, argv, envp) } static void -usage () +usage (status) + int status; { - fprintf (stderr, "\ -Usage: %s [{--help,--version}] [-] [-i] [-u name] [--ignore-environment]\n\ - [--unset=name] [name=value]... [command [args...]]\n", + fprintf (status == 0 ? stdout : stderr, "\ +Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n\ +", program_name); - exit (2); + + if (status != 0) + fprintf (stderr, "\nTry `%s --help' for more information.\n", + program_name); + else + + printf ("\ +\n\ + -u, --unset NAME remove variable from the environment\n\ + -i, --ignore-environment start with an empty environment\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +\n\ +A mere - implies -i. If no COMMAND, print the resulting environment.\n\ +"); + + exit (status); } |