From 97fea7c648d3342c0ad119e08a195f00454bf6b7 Mon Sep 17 00:00:00 2001 From: Richard Kettlewell Date: Fri, 2 May 2014 21:38:44 +0100 Subject: Command: add missing --help entries --- src/test-command.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/test-command.cc (limited to 'src/test-command.cc') diff --git a/src/test-command.cc b/src/test-command.cc new file mode 100644 index 0000000..b38062c --- /dev/null +++ b/src/test-command.cc @@ -0,0 +1,32 @@ +// Copyright © 2014 Richard Kettlewell. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#include +#include "Command.h" +#include "Conf.h" +#include + +int main() { + int errors = 0; + const std::string h = Command::helpString(); + for(size_t n = 0; Command::options[n].name; ++n) { + std::string full = "--" + std::string(Command::options[n].name); + if(h.find(full + ",") == std::string::npos + && h.find(full + " ") == std::string::npos) { + fprintf(stderr, "ERROR: help for option %s not found\n", full.c_str()); + ++errors; + } + } + return !!errors; +} -- cgit v1.2.3