Blame SOURCES/open-iscsi-2.0.874-35-iscsiuio-fix-long-options.patch

e88930
From 06851794fe0475410f516e874ee0c67db4a6784a Mon Sep 17 00:00:00 2001
e88930
From: Andrew Patterson <andrew.patterson@hpe.com>
e88930
Date: Wed, 31 May 2017 10:30:21 -0600
e88930
Subject: [PATCH] iscsiuio: fix long options
e88930
e88930
Fix broken long command-line options in iscsiuio.
e88930
---
e88930
 iscsiuio/docs/iscsiuio.8 | 10 +++++-----
e88930
 iscsiuio/src/unix/main.c | 12 +++++++-----
e88930
 2 files changed, 12 insertions(+), 10 deletions(-)
e88930
e88930
diff --git a/iscsiuio/docs/iscsiuio.8 b/iscsiuio/docs/iscsiuio.8
e88930
index 8b0577a53842..eda20c76637f 100644
e88930
--- a/iscsiuio/docs/iscsiuio.8
e88930
+++ b/iscsiuio/docs/iscsiuio.8
e88930
@@ -45,7 +45,7 @@ on how to configure network protocol and address.
e88930
 .SH PARAMETERS
e88930
 There are very few parameters when running this application.
e88930
 .TP
e88930
-.BI -d <debug level>
e88930
+.BI -d|--debug <debug level>
e88930
 This is to enable debug mode where debug messages will be sent to stdout
e88930
 The following debug modes are supported
e88930
 .P
e88930
@@ -61,20 +61,20 @@ ERROR         1 - Only print critical errors
e88930
 .PP
e88930
 .TP
e88930
 .TP
e88930
-.BI -f
e88930
+.BI -f|--foreground
e88930
 This is to enable foreground mode so that this application doesn't get sent
e88930
 into the background.
e88930
 .PP
e88930
 .TP
e88930
-.BI -v
e88930
+.BI -v|--version
e88930
 This is to print the version.
e88930
 .PP
e88930
 .TP
e88930
-.BI -p <pidfile>
e88930
+.BI -p|--pid <pidfile>
e88930
 Use pidfile (default  /var/run/iscsiuio.pid )
e88930
 .PP
e88930
 .TP
e88930
-.BI -h
e88930
+.BI -h|--help
e88930
 Display this help and exit.
e88930
 
e88930
 
e88930
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c
e88930
index c1a72d800741..5cccc76ed220 100644
e88930
--- a/iscsiuio/src/unix/main.c
e88930
+++ b/iscsiuio/src/unix/main.c
e88930
@@ -82,10 +82,12 @@ static const char default_pid_filepath[] = "/var/run/iscsiuio.pid";
e88930
  *  Global Variables
e88930
  ******************************************************************************/
e88930
 static const struct option long_options[] = {
e88930
-	{"debug", 0, 0, 0},
e88930
-	{"version", 0, 0, 0},
e88930
-	{"help", 0, 0, 0},
e88930
-	{0, 0, 0, 0}
e88930
+	{"foreground", no_argument, NULL, 'f'},
e88930
+	{"debug", required_argument, NULL, 'd'},
e88930
+	{"pid", required_argument, NULL, 'p'},
e88930
+	{"version", no_argument, NULL, 'v'},
e88930
+	{"help", no_argument, NULL, 'h'},
e88930
+	{NULL, no_argument, NULL, 0}
e88930
 };
e88930
 
e88930
 struct options opt = {
e88930
@@ -172,7 +174,7 @@ static void main_usage()
e88930
 	printf("iscsiuio daemon.\n"
e88930
 	       "-f, --foreground        make the program run in the foreground\n"
e88930
 	       "-d, --debug debuglevel  print debugging information\n"
e88930
-	       "-p, --pid=pidfile       use pid file (default  %s).\n"
e88930
+	       "-p, --pid pidfile       use pid file (default  %s).\n"
e88930
 	       "-h, --help              display this help and exit\n"
e88930
 	       "-v, --version           display version and exit\n",
e88930
 	       default_pid_filepath);
e88930
-- 
e88930
2.17.2
e88930