summaryrefslogtreecommitdiff
path: root/server/src/macrotool_dump.cc
diff options
context:
space:
mode:
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;
}