aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/cpupower/utils/cpupower.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/power/cpupower/utils/cpupower.c')
-rw-r--r--tools/power/cpupower/utils/cpupower.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/power/cpupower/utils/cpupower.c b/tools/power/cpupower/utils/cpupower.c
index b048e5595359..5844ae0f786f 100644
--- a/tools/power/cpupower/utils/cpupower.c
+++ b/tools/power/cpupower/utils/cpupower.c
@@ -50,8 +50,8 @@ static struct cmd_struct commands[] = {
50 { "set", cmd_set, set_help, 1 }, 50 { "set", cmd_set, set_help, 1 },
51 { "info", cmd_info, info_help, 0 }, 51 { "info", cmd_info, info_help, 0 },
52 { "monitor", cmd_monitor, monitor_help, 0 }, 52 { "monitor", cmd_monitor, monitor_help, 0 },
53 { "help", cmd_help, print_help, 0 }, 53 { "help", cmd_help, print_help, 0 },
54 // { "bench", cmd_bench, NULL, 1 }, 54 /* { "bench", cmd_bench, NULL, 1 }, */
55}; 55};
56 56
57int cmd_help(int argc, const char **argv) 57int cmd_help(int argc, const char **argv)
@@ -95,8 +95,9 @@ static void print_help(void)
95 printf(_("\nUse cpupower help subcommand for getting help for above subcommands.\n")); 95 printf(_("\nUse cpupower help subcommand for getting help for above subcommands.\n"));
96} 96}
97 97
98static void print_version(void) { 98static void print_version(void)
99 printf(PACKAGE " " VERSION "\n"); 99{
100 printf(PACKAGE " " VERSION "\n");
100 printf(_("Report errors and bugs to %s, please.\n"), PACKAGE_BUGREPORT); 101 printf(_("Report errors and bugs to %s, please.\n"), PACKAGE_BUGREPORT);
101} 102}
102 103
@@ -109,10 +110,10 @@ static void handle_options(int *argc, const char ***argv)
109 110
110 for (x = 0; x < *argc && ((*argv)[x])[0] == '-'; x++) { 111 for (x = 0; x < *argc && ((*argv)[x])[0] == '-'; x++) {
111 const char *param = (*argv)[x]; 112 const char *param = (*argv)[x];
112 if (!strcmp(param, "-h") || !strcmp(param, "--help")){ 113 if (!strcmp(param, "-h") || !strcmp(param, "--help")) {
113 print_help(); 114 print_help();
114 exit(EXIT_SUCCESS); 115 exit(EXIT_SUCCESS);
115 } else if (!strcmp(param, "-c") || !strcmp(param, "--cpu")){ 116 } else if (!strcmp(param, "-c") || !strcmp(param, "--cpu")) {
116 if (*argc < 2) { 117 if (*argc < 2) {
117 print_help(); 118 print_help();
118 exit(EXIT_FAILURE); 119 exit(EXIT_FAILURE);
@@ -132,13 +133,14 @@ static void handle_options(int *argc, const char ***argv)
132 /* Cut out param: cpupower -c 1 info -> cpupower info */ 133 /* Cut out param: cpupower -c 1 info -> cpupower info */
133 new_argc += 2; 134 new_argc += 2;
134 continue; 135 continue;
135 } else if (!strcmp(param, "-v") || !strcmp(param, "--version")){ 136 } else if (!strcmp(param, "-v") ||
137 !strcmp(param, "--version")) {
136 print_version(); 138 print_version();
137 exit(EXIT_SUCCESS); 139 exit(EXIT_SUCCESS);
138#ifdef DEBUG 140#ifdef DEBUG
139 } else if (!strcmp(param, "-d") || !strcmp(param, "--debug")){ 141 } else if (!strcmp(param, "-d") || !strcmp(param, "--debug")) {
140 be_verbose = 1; 142 be_verbose = 1;
141 new_argc ++; 143 new_argc++;
142 continue; 144 continue;
143#endif 145#endif
144 } else { 146 } else {
@@ -171,7 +173,7 @@ int main(int argc, const char *argv[])
171 } 173 }
172 174
173 setlocale(LC_ALL, ""); 175 setlocale(LC_ALL, "");
174 textdomain (PACKAGE); 176 textdomain(PACKAGE);
175 177
176 /* Turn "perf cmd --help" into "perf help cmd" */ 178 /* Turn "perf cmd --help" into "perf help cmd" */
177 if (argc > 1 && !strcmp(argv[1], "--help")) { 179 if (argc > 1 && !strcmp(argv[1], "--help")) {