diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-23 23:23:26 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-23 23:23:26 -0800 |
commit | 5eb28e5bbb97a1c1faa0d77c85c8d566e3e4fcdf (patch) | |
tree | c7a4e0e25277f52400f28b31fac7b9cdb4068476 | |
parent | 53a484fbd297a03bfbe7d656818c94a4c4b071fe (diff) |
Print which option was in error along with usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | smproxy.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1168,17 +1168,27 @@ main (int argc, char *argv[]) continue; case 'c': /* -clientId */ - if (++i >= argc) goto usage; + if (++i >= argc) { + fprintf (stderr, "%s: -clientId requires an argument\n", + argv[0]); + goto usage; + } client_id = argv[i]; continue; case 'r': /* -restore */ - if (++i >= argc) goto usage; + if (++i >= argc) { + fprintf (stderr, "%s: -restore requires an argument\n", + argv[0]); + goto usage; + } restore_filename = argv[i]; continue; } } + fprintf (stderr, "%s: unrecognized argument: %s\n", argv[0], argv[i]); + usage: fprintf (stderr, |