diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-04-19 20:33:50 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-07-29 18:35:39 +0200 |
commit | a1ce5ba2b7d08ab6347dc254f86f70e91c5f1a44 (patch) | |
tree | 22d59faf4df1547bb9547935c7f63c3ef6a6b387 /tools/power/cpupower/utils/cpupower.c | |
parent | cpupowerutils: helpers - ConfigStyle bugfixes (diff) | |
download | linux-a1ce5ba2b7d08ab6347dc254f86f70e91c5f1a44.tar.xz linux-a1ce5ba2b7d08ab6347dc254f86f70e91c5f1a44.zip |
cpupowerutils: utils - ConfigStyle bugfixes
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to '')
-rw-r--r-- | tools/power/cpupower/utils/cpupower.c | 22 |
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[] = { { "set", cmd_set, set_help, 1 }, { "info", cmd_info, info_help, 0 }, { "monitor", cmd_monitor, monitor_help, 0 }, - { "help", cmd_help, print_help, 0 }, - // { "bench", cmd_bench, NULL, 1 }, + { "help", cmd_help, print_help, 0 }, + /* { "bench", cmd_bench, NULL, 1 }, */ }; int cmd_help(int argc, const char **argv) @@ -95,8 +95,9 @@ static void print_help(void) printf(_("\nUse cpupower help subcommand for getting help for above subcommands.\n")); } -static void print_version(void) { - printf(PACKAGE " " VERSION "\n"); +static void print_version(void) +{ + printf(PACKAGE " " VERSION "\n"); printf(_("Report errors and bugs to %s, please.\n"), PACKAGE_BUGREPORT); } @@ -109,10 +110,10 @@ static void handle_options(int *argc, const char ***argv) for (x = 0; x < *argc && ((*argv)[x])[0] == '-'; x++) { const char *param = (*argv)[x]; - if (!strcmp(param, "-h") || !strcmp(param, "--help")){ + if (!strcmp(param, "-h") || !strcmp(param, "--help")) { print_help(); exit(EXIT_SUCCESS); - } else if (!strcmp(param, "-c") || !strcmp(param, "--cpu")){ + } else if (!strcmp(param, "-c") || !strcmp(param, "--cpu")) { if (*argc < 2) { print_help(); exit(EXIT_FAILURE); @@ -132,13 +133,14 @@ static void handle_options(int *argc, const char ***argv) /* Cut out param: cpupower -c 1 info -> cpupower info */ new_argc += 2; continue; - } else if (!strcmp(param, "-v") || !strcmp(param, "--version")){ + } else if (!strcmp(param, "-v") || + !strcmp(param, "--version")) { print_version(); exit(EXIT_SUCCESS); #ifdef DEBUG - } else if (!strcmp(param, "-d") || !strcmp(param, "--debug")){ + } else if (!strcmp(param, "-d") || !strcmp(param, "--debug")) { be_verbose = 1; - new_argc ++; + new_argc++; continue; #endif } else { @@ -171,7 +173,7 @@ int main(int argc, const char *argv[]) } setlocale(LC_ALL, ""); - textdomain (PACKAGE); + textdomain(PACKAGE); /* Turn "perf cmd --help" into "perf help cmd" */ if (argc > 1 && !strcmp(argv[1], "--help")) { |