summaryrefslogtreecommitdiff
path: root/server/src/macrotool_dump.cc
diff options
context:
space:
mode:
authordeva <deva>2009-07-06 13:50:56 +0000
committerdeva <deva>2009-07-06 13:50:56 +0000
commitca32aba4df1b021b1acaa8f0650fa6a0cd7b9d80 (patch)
treec5556cefdc68846cf3c3343d54ae964c43ba65ec /server/src/macrotool_dump.cc
parentce3ee895ae8c893c0202e4cddb068dce9919cd0d (diff)
Rewrite of parameter handler. A new fieldnames module... currently does nothing useful.
Diffstat (limited to 'server/src/macrotool_dump.cc')
-rw-r--r--server/src/macrotool_dump.cc30
1 files changed, 24 insertions, 6 deletions
diff --git a/server/src/macrotool_dump.cc b/server/src/macrotool_dump.cc
index 93a96a3..9248d03 100644
--- a/server/src/macrotool_dump.cc
+++ b/server/src/macrotool_dump.cc
@@ -264,23 +264,41 @@ static void dump_templates()
}
}
-void macrotool_dump(std::string param)
+void macrotool_dump(std::vector<std::string> params)
{
- PRACRO_DEBUG(dump, "dump: %s\n", param.c_str());
-
- if(param == "help") {
+ if(params.size() < 1) {
printf(usage_str);
return;
}
- if(param == "macros") {
+ PRACRO_DEBUG(fieldnames, "dump: %s\n", params[0].c_str());
+
+ if(params[0] == "macros") {
+ if(params.size() != 1) {
+ printf("The command 'macro' doen't take any parameters.\n");
+ printf(usage_str);
+ return;
+ }
dump_macros();
return;
}
- if(param == "templates") {
+ if(params[0] == "templates") {
+ if(params.size() != 1) {
+ printf("The command 'templates' doen't take any parameters.\n");
+ printf(usage_str);
+ return;
+ }
dump_templates();
return;
}
+ if(params[0] == "help") {
+ printf(usage_str);
+ return;
+ }
+
+ printf("Unknown command '%s'\n", params[0].c_str());
+ printf(usage_str);
+ return;
}