diff options
author | Jim Meyering <jim@meyering.net> | 2003-05-10 13:47:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-05-10 13:47:38 +0000 |
commit | 49f700b61c99ab294450d65c9d55714f1c29452a (patch) | |
tree | b8f00d980c1e081c5b11a19164cb6814080005fe | |
parent | f4c0d12cb0c306fc4140321425cc9a786a202fa5 (diff) | |
download | coreutils-49f700b61c99ab294450d65c9d55714f1c29452a.tar.gz |
(main): When failing due to unaccepted arguments,
also say `too many arguments' rather than just `Try `uname --help'
for more information.'.
-rw-r--r-- | src/uname.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/uname.c b/src/uname.c index ad487e334..9f613fdc3 100644 --- a/src/uname.c +++ b/src/uname.c @@ -1,6 +1,6 @@ /* uname -- print system information - Copyright 1989, 1992, 1993, 1996, 1997, 1999, 2000, 2001, 2002 Free + Copyright 1989, 1992, 1993, 1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -210,8 +210,11 @@ main (int argc, char **argv) } } - if (optind != argc) - usage (EXIT_FAILURE); + if (argc < optind) + { + error (0, 0, _("too many arguments")); + usage (EXIT_FAILURE); + } if (toprint == 0) toprint = PRINT_KERNEL_NAME; |