All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] rpc.idmapd: Added a usage routine
Date: Sat, 12 Dec 2015 07:14:45 -0500	[thread overview]
Message-ID: <566C0FB5.6030902@RedHat.com> (raw)
In-Reply-To: <1449676902-19575-1-git-send-email-steved@redhat.com>



On 12/09/2015 11:01 AM, Steve Dickson wrote:
> Show the correct arguments when invalid
> arguments are used.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...

steved.

> ---
>  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;
> 

      parent reply	other threads:[~2015-12-12 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 16:01 [PATCH 1/2] rpc.idmapd: Added a usage routine Steve Dickson
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 ` Steve Dickson [this message]

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=566C0FB5.6030902@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.