rpc.idmapd: Added a usage routine
Subsystems (2)
PATCH 1/2 rpc.idmapd: Added a usage routine
Show the correct arguments when invalid
arguments are used.
Signed-off-by Steve Dickson <[email protected]>
--- utils/idmapd/idmapd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
utils/idmapd/idmapd.c +10 -2
@@ -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 ;
Signature · 1 line
2.4.3
PATCH 2/2 rpc.idmapd: Added the -C and -S flags
The C and S flags were missing for the SYNOPSIS
Signed-off-by Steve Dickson <[email protected]>
--- utils/idmapd/idmapd.man | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
utils/idmapd/idmapd.man +3 -1
@@ -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
Signature · 1 line
2.4.3
Re: [PATCH 2/2] rpc.idmapd: Added the -C and -S flags
Quoted 3 lines · Steve Dickson
The C and S flags were missing for the SYNOPSIS
Signed-off-by Steve Dickson <[email protected]>
Committed....
steved.
Quoted 21 lines
--- utils/idmapd/idmapd.man | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)utils/idmapd/idmapd.man +3
-1@@ -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
Quoted 4 lines · Steve Dickson
Show the correct arguments when invalid
arguments are used.Signed-off-by Steve Dickson <[email protected]>
Committed...
steved.
Quoted 36 lines
--- utils/idmapd/idmapd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)utils/idmapd/idmapd.c +10
-2@@ -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 ;