]> git.cworth.org Git - apitrace/commitdiff
Give CLI command names a _command prefix
authorCarl Worth <cworth@cworth.org>
Tue, 1 Nov 2011 20:47:26 +0000 (13:47 -0700)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 3 Nov 2011 11:47:09 +0000 (11:47 +0000)
This is just to set things up for a trace_command command, (which
cannot be named "trace" since that would conflict with "namespace
trace").

cli/cli.hpp
cli/cli_dump.cpp
cli/cli_main.cpp

index 0792aff382d148eecd8ea2ee1dd8117c9e9f8aa9..5236d8bbd8bd58bce0cfca7895f51318ac3f072d 100644 (file)
@@ -40,8 +40,6 @@ struct Command {
     Function function;
 };
 
-
-extern const Command dump;
-
+extern const Command dump_command;
 
 #endif /* _APITRACE_CLI_HPP_ */
index 2164518d5e264712f7729596bfc90048f5b5b3c4..5baa5ae88b44b11378f9360dc6201e8f00135488 100644 (file)
@@ -114,7 +114,7 @@ command(int argc, char *argv[])
     return 0;
 }
 
-const Command dump = {
+const Command dump_command = {
     "dump",
     synopsis,
     usage,
index 03587d766e97d84f286f552ca339ecd558195ef0..981f39e416f2a514dc6de1123f3c0451835acf22 100644 (file)
@@ -56,18 +56,18 @@ help_usage()
 }
 
 static int
-help_command(int argc, char *argv[]);
+do_help_command(int argc, char *argv[]);
 
-const Command help = {
+const Command help_command = {
     "help",
     help_synopsis,
     help_usage,
-    help_command
+    do_help_command
 };
 
 static const Command * commands[] = {
-    &dump,
-    &help,
+    &dump_command,
+    &help_command
 };
 
 static void
@@ -110,7 +110,7 @@ list_commands(void) {
 
 
 static int
-help_command(int argc, char *argv[])
+do_help_command(int argc, char *argv[])
 {
     const Command *command;
     int i;
@@ -152,7 +152,7 @@ main(int argc, char **argv)
         }
 
         if (strcmp(arg, "--help") == 0) {
-            return help_command(0, NULL);
+            return do_help_command(0, NULL);
         } else {
             std::cerr << "Error: unknown option " << arg << "\n";
             usage();