summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-23 23:23:26 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-23 23:23:26 -0800
commit5eb28e5bbb97a1c1faa0d77c85c8d566e3e4fcdf (patch)
treec7a4e0e25277f52400f28b31fac7b9cdb4068476
parent53a484fbd297a03bfbe7d656818c94a4c4b071fe (diff)
Print which option was in error along with usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--smproxy.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/smproxy.c b/smproxy.c
index 7c59f16..3ceb880 100644
--- a/smproxy.c
+++ b/smproxy.c
@@ -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,