From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/2] rpc.idmapd: Added a usage routine
Date: Wed, 9 Dec 2015 11:01:41 -0500 [thread overview]
Message-ID: <1449676902-19575-1-git-send-email-steved@redhat.com> (raw)
Show the correct arguments when invalid
arguments are used.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/idmapd/idmapd.c | 12 ++++++++++--
1 file 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;
--
2.4.3
next reply other threads:[~2015-12-09 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 16:01 Steve Dickson [this message]
2015-12-09 16:01 ` [PATCH 2/2] rpc.idmapd: Added the -C and -S flags Steve Dickson
2015-12-12 12:14 ` Steve Dickson
2015-12-12 12:14 ` [PATCH 1/2] rpc.idmapd: Added a usage routine Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449676902-19575-1-git-send-email-steved@redhat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox