diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-10-30 14:21:03 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-10-30 14:21:03 +0000 |
commit | 3c167fe5060d5fcd49422ef47c9602f6aedd978c (patch) | |
tree | 1c64eee12d625647231609d276b72ba507498df9 /cli/cli_dump.cpp | |
parent | 646a00d12f31f75fa444d356a667fd64bd0ec323 (diff) |
Better isolation of CLI source files.
Diffstat (limited to 'cli/cli_dump.cpp')
-rw-r--r-- | cli/cli_dump.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/cli/cli_dump.cpp b/cli/cli_dump.cpp index 3a428dbb..9f7752ec 100644 --- a/cli/cli_dump.cpp +++ b/cli/cli_dump.cpp @@ -37,19 +37,22 @@ enum ColorOption { static ColorOption color = COLOR_OPTION_AUTO; -void -apitrace_dump_usage(void) +static const char *synopsis = "Dump given trace(s) to standard output."; + +static void +usage(void) { - std::cout << "usage: apitrace dump [OPTIONS] <trace-file>...\n" - APITRACE_DUMP_SYNOPSIS "\n" + std::cout + << "usage: apitrace dump [OPTIONS] <trace-file>...\n" + << synopsis << "\n" "\n" " --color=<WHEN>\n" " --colour=<WHEN> Colored syntax highlighting\n" " WHEN is 'auto', 'always', or 'never'\n"; } -int -apitrace_dump_command(int argc, char *argv[], int first_arg_command) +static int +command(int argc, char *argv[], int first_arg_command) { int i; @@ -63,7 +66,7 @@ apitrace_dump_command(int argc, char *argv[], int first_arg_command) if (!strcmp(arg, "--")) { break; } else if (!strcmp(arg, "--help")) { - apitrace_dump_usage(); + usage(); return 0; } else if (!strcmp(arg, "--color=auto") || !strcmp(arg, "--colour=auto")) { @@ -80,7 +83,7 @@ apitrace_dump_command(int argc, char *argv[], int first_arg_command) color = COLOR_OPTION_NEVER; } else { std::cerr << "error: unknown option " << arg << "\n"; - apitrace_dump_usage(); + usage(); return 1; } } @@ -110,3 +113,10 @@ apitrace_dump_command(int argc, char *argv[], int first_arg_command) return 0; } + +const Command dump = { + "dump", + synopsis, + usage, + command +}; |