diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-08-06 18:11:43 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-08-19 17:13:56 +0200 |
commit | 498ca793d90aef8ad38a852a969c257f62832738 (patch) | |
tree | a438621de8b6921c2749a2e5d68f34428f25d37f /tools/power/cpupower/utils/cpuidle-info.c | |
parent | 47c336307a3680cfdf4adbe718d79f3fe66702ea (diff) | |
download | blackbird-obmc-linux-498ca793d90aef8ad38a852a969c257f62832738.tar.gz blackbird-obmc-linux-498ca793d90aef8ad38a852a969c257f62832738.zip |
cpupower: use man(1) when calling "cpupower help subcommand"
Instead of printing something non-formatted to stdout, call
man(1) to show the man page for the proper subcommand.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools/power/cpupower/utils/cpuidle-info.c')
-rw-r--r-- | tools/power/cpupower/utils/cpuidle-info.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c index 70da3574f1e9..b028267c1376 100644 --- a/tools/power/cpupower/utils/cpuidle-info.c +++ b/tools/power/cpupower/utils/cpuidle-info.c @@ -139,30 +139,14 @@ static void proc_cpuidle_cpu_output(unsigned int cpu) } } -/* --freq / -f */ - -void idle_info_help(void) -{ - printf(_ ("Usage: cpupower idleinfo [options]\n")); - printf(_ ("Options:\n")); - printf(_ (" -s, --silent Only show general C-state information\n")); - printf(_ (" -o, --proc Prints out information like provided by the /proc/acpi/processor/*/power\n" - " interface in older kernels\n")); - printf(_ (" -h, --help Prints out this screen\n")); - - printf("\n"); -} - static struct option info_opts[] = { { .name = "silent", .has_arg = no_argument, .flag = NULL, .val = 's'}, { .name = "proc", .has_arg = no_argument, .flag = NULL, .val = 'o'}, - { .name = "help", .has_arg = no_argument, .flag = NULL, .val = 'h'}, { }, }; static inline void cpuidle_exit(int fail) { - idle_info_help(); exit(EXIT_FAILURE); } @@ -174,7 +158,7 @@ int cmd_idle_info(int argc, char **argv) unsigned int cpu = 0; do { - ret = getopt_long(argc, argv, "hos", info_opts, NULL); + ret = getopt_long(argc, argv, "os", info_opts, NULL); if (ret == -1) break; switch (ret) { @@ -182,10 +166,6 @@ int cmd_idle_info(int argc, char **argv) output_param = '?'; cont = 0; break; - case 'h': - output_param = 'h'; - cont = 0; - break; case 's': verbose = 0; break; @@ -211,8 +191,6 @@ int cmd_idle_info(int argc, char **argv) case '?': printf(_("invalid or unknown argument\n")); cpuidle_exit(EXIT_FAILURE); - case 'h': - cpuidle_exit(EXIT_SUCCESS); } /* Default is: show output of CPU 0 only */ |