[fedfs-utils] [PATCH 6/8] fedfsc: fedfs-lookup-{junction, replication} should assume "-t none"

Chuck Lever chuck.lever at oracle.com
Mon Sep 19 15:42:41 PDT 2011


For ease of use, make the fedfs-lookup-junction command assume that
the "-t" option has a value of "none" by default.  Same for the
fedfs-lookup-replication command.

Signed-off-by: Chuck Lever <chuck.lever at oracle.com>
---

 doc/man/fedfs-lookup-junction.8       |    5 ++++-
 doc/man/fedfs-lookup-replication.8    |    5 ++++-
 src/fedfsc/fedfs-lookup-junction.c    |    9 +++++----
 src/fedfsc/fedfs-lookup-replication.c |   11 ++++++-----
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/doc/man/fedfs-lookup-junction.8 b/doc/man/fedfs-lookup-junction.8
index cc1e936..2b199dc 100644
--- a/doc/man/fedfs-lookup-junction.8
+++ b/doc/man/fedfs-lookup-junction.8
@@ -33,8 +33,9 @@ fedfs-lookup-junction \- send a FEDFS_LOOKUP_JUNCTION ADMIN protocol request
 .IR nettype ]
 .RB [ \-h
 .IR hostname ]
+.RB [ \-t
+.IR resolvetype ]
 .BI "-p " path
-.BI "-t " type
 .SH INTRODUCTION
 RFC 5716 introduces the Federated File System (FedFS, for short).
 FedFS is an extensible standardized mechanism
@@ -135,6 +136,8 @@ are
 .BR nsdb ", or"
 .BR fedfs_resolve_nsdb .
 The value is not case-sensitive.
+If this option is not specified, the default value is
+.BR none .
 .SH EXIT CODES
 The remote administration service returns a value that reflects the
 success of the requested operation.
diff --git a/doc/man/fedfs-lookup-replication.8 b/doc/man/fedfs-lookup-replication.8
index c241a61..0301169 100644
--- a/doc/man/fedfs-lookup-replication.8
+++ b/doc/man/fedfs-lookup-replication.8
@@ -33,8 +33,9 @@ fedfs-lookup-replication \- send a FEDFS_LOOKUP_REPLICATION ADMIN protocol reque
 .IR nettype ]
 .RB [ \-h
 .IR hostname ]
+.RB [ \-t
+.IR resolvetype ]
 .BI "-p " path
-.BI "-t " type
 .SH INTRODUCTION
 RFC 5716 introduces the Federated File System (FedFS, for short).
 FedFS is an extensible standardized mechanism
@@ -135,6 +136,8 @@ are
 .BR nsdb ", or"
 .BR fedfs_resolve_nsdb .
 The value is not case-sensitive.
+If this option is not specified, the default value is
+.BR none .
 .SH EXIT CODES
 The remote administration service returns a value that reflects the
 success of the requested operation.
diff --git a/src/fedfsc/fedfs-lookup-junction.c b/src/fedfsc/fedfs-lookup-junction.c
index 5489f92..5ce33cc 100644
--- a/src/fedfsc/fedfs-lookup-junction.c
+++ b/src/fedfsc/fedfs-lookup-junction.c
@@ -73,14 +73,14 @@ fedfs_lookup_junction_usage(const char *progname)
 {
 	fprintf(stderr, "\n%s version " VERSION "\n", progname);
 	fprintf(stderr, "Usage: %s [-d] [-n nettype] [-h hostname] "
-			"-p path -t <none|cache|nsdb>\n\n", progname);
+			"[-t <none|cache|nsdb>] -p path\n\n", progname);
 
 	fprintf(stderr, "\t-?, --help           Print this help\n");
 	fprintf(stderr, "\t-d, --debug          Enable debug messages\n");
 	fprintf(stderr, "\t-n, --nettype        RPC transport (default: 'netpath')\n");
 	fprintf(stderr, "\t-h, --hostname       ADMIN server hostname (default: 'localhost')\n");
 	fprintf(stderr, "\t-p, --path           Pathname of junction to resolve\n");
-	fprintf(stderr, "\t-t, --resolvetype    Type of desired result\n");
+	fprintf(stderr, "\t-t, --resolvetype    Type of desired result (default: 'none')\n");
 
 	fprintf(stderr, "%s", fedfs_gpl_boilerplate);
 
@@ -280,7 +280,8 @@ main(int argc, char **argv)
 
 	hostname = "localhost";
 	nettype = "netpath";
-	path = resolvetype = NULL;
+	resolvetype = "none";
+	path = NULL;
 	while ((arg = getopt_long(argc, argv, fedfs_lookup_junction_opts,
 				fedfs_lookup_junction_longopts, NULL)) != -1) {
 		switch (arg) {
@@ -309,7 +310,7 @@ main(int argc, char **argv)
 		fprintf(stderr, "Unrecognized command line argument\n");
 		fedfs_lookup_junction_usage(progname);
 	}
-	if (path == NULL || resolvetype == NULL) {
+	if (path == NULL) {
 		fprintf(stderr, "Missing required command line argument\n");
 		fedfs_lookup_junction_usage(progname);
 	}
diff --git a/src/fedfsc/fedfs-lookup-replication.c b/src/fedfsc/fedfs-lookup-replication.c
index ea68034..d33c45d 100644
--- a/src/fedfsc/fedfs-lookup-replication.c
+++ b/src/fedfsc/fedfs-lookup-replication.c
@@ -72,15 +72,15 @@ static void
 fedfs_lookup_replication_usage(const char *progname)
 {
 	fprintf(stderr, "\n%s version " VERSION "\n", progname);
-	fprintf(stderr, "Usage: %s [-d] [-n nettype] [-h hostname] -p path "
-			"-t <none|cache|nsdb>\n\n", progname);
+	fprintf(stderr, "Usage: %s [-d] [-n nettype] [-h hostname] "
+			"[-t <none|cache|nsdb>] -p path\n\n", progname);
 
 	fprintf(stderr, "\t-?, --help           Print this help\n");
 	fprintf(stderr, "\t-d, --debug          Enable debug messages\n");
 	fprintf(stderr, "\t-n, --nettype        RPC transport (default: 'netpath')\n");
 	fprintf(stderr, "\t-h, --hostname       ADMIN server hostname (default: 'localhost')\n");
 	fprintf(stderr, "\t-p, --path           Pathname of replication to resolve\n");
-	fprintf(stderr, "\t-t, --resolvetype    Type of desired result\n");
+	fprintf(stderr, "\t-t, --resolvetype    Type of desired result (default: 'none')\n");
 
 	fprintf(stderr, "%s", fedfs_gpl_boilerplate);
 
@@ -285,7 +285,8 @@ main(int argc, char **argv)
 
 	hostname = "localhost";
 	nettype = "netpath";
-	path = resolvetype = NULL;
+	resolvetype = "none";
+	path = NULL;
 	while ((arg = getopt_long(argc, argv, fedfs_lookup_replication_opts,
 				fedfs_lookup_replication_longopts, NULL)) != -1) {
 		switch (arg) {
@@ -314,7 +315,7 @@ main(int argc, char **argv)
 		fprintf(stderr, "Unrecognized command line argument\n");
 		fedfs_lookup_replication_usage(progname);
 	}
-	if (path == NULL || resolvetype == NULL) {
+	if (path == NULL) {
 		fprintf(stderr, "Missing required command line argument\n");
 		fedfs_lookup_replication_usage(progname);
 	}




More information about the fedfs-utils-devel mailing list