[PATCH 3/7] cifs.idmap: add an options struct to handle long options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



...since the manpage advertises them.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx>
---
 cifs.idmap.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cifs.idmap.c b/cifs.idmap.c
index bfef58b..ea22300 100644
--- a/cifs.idmap.c
+++ b/cifs.idmap.c
@@ -44,6 +44,11 @@
 
 static const char *prog = "cifs.idmap";
 
+static const struct option long_options[] = {
+	{"version", 0, NULL, 'v'},
+	{NULL, 0, NULL, 0}
+};
+
 static void usage(void)
 {
 	fprintf(stderr, "Usage: %s key_serial\n", prog);
@@ -189,7 +194,7 @@ int main(const int argc, char *const argv[])
 
 	openlog(prog, 0, LOG_DAEMON);
 
-	while ((c = getopt_long(argc, argv, "v", NULL, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "v", long_options, NULL)) != -1) {
 		switch (c) {
 		case 'v':
 			printf("version: %s\n", VERSION);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux