diff options
author | Steve Dickson <steved@redhat.com> | 2015-12-11 11:10:12 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-12-11 11:22:25 -0500 |
commit | d91d3c0b4754284808dfd2c7faf64d0cd96c5ae7 (patch) | |
tree | 8450a6410c375141b707161da616b7774c1661b4 | |
parent | 51f51533155f70ce623bfeed2514512eb9473b63 (diff) | |
download | nfs-utils-d91d3c0b4754284808dfd2c7faf64d0cd96c5ae7.tar.gz nfs-utils-d91d3c0b4754284808dfd2c7faf64d0cd96c5ae7.tar.xz nfs-utils-d91d3c0b4754284808dfd2c7faf64d0cd96c5ae7.zip |
rpc.idmapd: Added a usage routine
Show the correct arguments when invalid
arguments are used.
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/idmapd/idmapd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index 689608a..910b02e 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -199,6 +199,12 @@ flush_nfsd_idmap_cache(void) return ret; } +void usage(char *progname) +{ + fprintf(stderr, "Usage: %s [-fvCS] [-p path] [-c path]\n", + basename(progname)); +} + int main(int argc, char **argv) { @@ -232,9 +238,11 @@ main(int argc, char **argv) conf_path = optarg; if (opt == '?') { if (strchr(GETOPTSTR, optopt)) - errx(1, "'-%c' option requires an argument.", optopt); + warnx("'-%c' option requires an argument.", optopt); else - errx(1, "'-%c' is an invalid argument.", optopt); + warnx("'-%c' is an invalid argument.", optopt); + usage(progname); + exit(1); } } optind = 1; |