From ca32aba4df1b021b1acaa8f0650fa6a0cd7b9d80 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 6 Jul 2009 13:50:56 +0000 Subject: Rewrite of parameter handler. A new fieldnames module... currently does nothing useful. --- server/src/macrotool_dump.cc | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'server/src/macrotool_dump.cc') 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 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; } -- cgit v1.2.3