diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-23 23:09:51 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-05-23 23:09:51 -0700 |
commit | 5d579a475beb6083c5321ea2293b7ec5c4328a62 (patch) | |
tree | ed164b9a03a4578fed389b3de6cd9cc24e053950 | |
parent | 4c717e41a5d894ef833815396b0de057b53213aa (diff) |
Print which option was in error along with usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xfsinfo.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -86,10 +86,15 @@ main(int argc, char *argv[]) for (i = 1; i < argc; i++) { if (strncmp(argv[i], "-s", 2) == 0) { - if (++i > argc) + if (++i >= argc) { + fprintf (stderr, "%s: %s requires an argument\n", + progname, argv[i-1]); usage(); + } servername = argv[i]; } else { + fprintf (stderr, "%s: unrecognized argument %s\n", + progname, argv[i]); usage(); } } |