Skip to contentSkip to conversation

Fixed -C and -r to take optional argument

PATCH New Jaroslav Škarvada <jskarvad at redhat.com> 2 participants 2 messages Nov 28, 2018 – Dec 3, 2018

lore
Share & tools
lore

Jaroslav Škarvada <jskarvad at redhat.com>

#0 lore raw

PATCH 1/1 Fixed -C and -r to take optional argument

I.e. it fixes the following:
powertop -C -t 1
...
Taking 1 measurement(s) for a duration of 20 second(s) each. PowerTOP outputing using base filename -t

But:
powertop --html -t 1
...
Taking 1 measurement(s) for a duration of 1 second(s) each. PowerTOP outputing using base filename powertop.html

Signed-off-by Jaroslav Škarvada <jskarvad(a)redhat.com>
---
 src/main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/main.cpp +1 -1
index 7467f0f..d1c18cc 100644
@@ -441,7 +441,7 @@ int main(int argc, char **argv)
 #endif
 	ui_notify_user = ui_notify_user_ncurses;
 	while (1) { /* parse commandline options */
-		c = getopt_long(argc, argv, "cC:r:i:qt:w:Vh", long_options, &option_index);
+		c = getopt_long(argc, argv, "cC::r::i:qt:w:Vh", long_options, &option_index);
 		/* Detect the end of the options. */
 		if (c == -1)
 			break;
Signature · 1 line
2.14.5
#1 lore raw

PATCH 1/1 Fixed -C and -r to take optional argument

Hi,

it seems git send-email didn't reach the list, so forwarding by hand (and rather sending the patch as a attachment)

thanks & regards

Jaroslav

----- Forwarded Message -----

Quoted 39 lines

From: "Jaroslav Škarvada" <jskarvad(a)redhat.com>
To: powertop(a)lists.01.org
Cc: "Jaroslav Škarvada" <jskarvad(a)redhat.com>
Sent: Wednesday, November 28, 2018 6:31:48 PM
Subject: [PATCH] Fixed -C and -r to take optional argument

I.e. it fixes the following:
powertop -C -t 1
...
Taking 1 measurement(s) for a duration of 20 second(s) each. PowerTOP outputing using base filename -t

But:
powertop --html -t 1
...
Taking 1 measurement(s) for a duration of 1 second(s) each. PowerTOP outputing using base filename powertop.html

Signed-off-by Jaroslav Škarvada <jskarvad(a)redhat.com>
---
 src/main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/main.cpp +1 -1
index 7467f0f..d1c18cc 100644
@@ -441,7 +441,7 @@ int main(int argc, char **argv)
 #endif
 	ui_notify_user = ui_notify_user_ncurses;
 	while (1) { /* parse commandline options */
-		c = getopt_long(argc, argv, "cC:r:i:qt:w:Vh", long_options,
 &option_index);
+		c = getopt_long(argc, argv, "cC::r::i:qt:w:Vh", long_options,
 &option_index);
 		/* Detect the end of the options. */
src/main.cpp +0 -1
 		if (c == -1)
 			break;
--
Quoted 3 lines

2.14.5

src/main.cpp +1 -1
index 7467f0f..d1c18cc 100644
@@ -441,7 +441,7 @@ int main(int argc, char **argv)
 #endif
 	ui_notify_user = ui_notify_user_ncurses;
 	while (1) { /* parse commandline options */
-		c = getopt_long(argc, argv, "cC:r:i:qt:w:Vh", long_options, &option_index);
+		c = getopt_long(argc, argv, "cC::r::i:qt:w:Vh", long_options, &option_index);
 		/* Detect the end of the options. */
 		if (c == -1)
 			break;