Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 1/2] rpc.idmapd: Added a usage routine
@ 2015-12-09 16:01 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 ` [PATCH 1/2] rpc.idmapd: Added a usage routine Steve Dickson
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Dickson @ 2015-12-09 16:01 UTC (permalink / raw)
  To: Linux NFS Mailing list

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] rpc.idmapd: Added the -C and -S flags
  2015-12-09 16:01 [PATCH 1/2] rpc.idmapd: Added a usage routine Steve Dickson
@ 2015-12-09 16:01 ` 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
  1 sibling, 1 reply; 4+ messages in thread
From: Steve Dickson @ 2015-12-09 16:01 UTC (permalink / raw)
  To: Linux NFS Mailing list

The C and S flags were missing for the SYNOPSIS

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/idmapd/idmapd.man | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utils/idmapd/idmapd.man b/utils/idmapd/idmapd.man
index c809f78..d45658e 100644
--- a/utils/idmapd/idmapd.man
+++ b/utils/idmapd/idmapd.man
@@ -10,8 +10,10 @@
 .Sh SYNOPSIS
 .\" For a program:  program [-abc] file ...
 .Nm rpc.idmapd
-.Op Fl v
 .Op Fl f
+.Op Fl v
+.Op Fl C
+.Op Fl S
 .Op Fl p Ar path
 .Op Fl c Ar path
 .Sh DESCRIPTION
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] rpc.idmapd: Added the -C and -S flags
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2015-12-12 12:14 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 12/09/2015 11:01 AM, Steve Dickson wrote:
> The C and S flags were missing for the SYNOPSIS
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed....

steved.

> ---
>  utils/idmapd/idmapd.man | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/idmapd/idmapd.man b/utils/idmapd/idmapd.man
> index c809f78..d45658e 100644
> --- a/utils/idmapd/idmapd.man
> +++ b/utils/idmapd/idmapd.man
> @@ -10,8 +10,10 @@
>  .Sh SYNOPSIS
>  .\" For a program:  program [-abc] file ...
>  .Nm rpc.idmapd
> -.Op Fl v
>  .Op Fl f
> +.Op Fl v
> +.Op Fl C
> +.Op Fl S
>  .Op Fl p Ar path
>  .Op Fl c Ar path
>  .Sh DESCRIPTION
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] rpc.idmapd: Added a usage routine
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2015-12-12 12:14 UTC (permalink / raw)
  To: Linux NFS Mailing list



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-12 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 1/2] rpc.idmapd: Added a usage routine Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox