diff options
-rw-r--r-- | src/cam/options.cpp | 12 | ||||
-rw-r--r-- | src/cam/options.h | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 721a808a..350c8084 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -902,8 +902,6 @@ OptionsParser::Options OptionsParser::parse(int argc, char **argv) */ void OptionsParser::usage() { - std::cerr << "Options:" << std::endl; - unsigned int indent = 0; for (const Option &option : options_) { @@ -923,7 +921,15 @@ void OptionsParser::usage() indent = (indent + 7) / 8 * 8; - for (const Option &option : options_) { + std::cerr << "Options:" << std::endl; + + usageOptions(options_, indent); +} + +void OptionsParser::usageOptions(const std::list<Option> &options, + unsigned int indent) +{ + for (const Option &option : options) { std::string argument; if (option.hasShortOption()) argument = std::string(" -") diff --git a/src/cam/options.h b/src/cam/options.h index 0b8bb172..01a5d36a 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -95,6 +95,8 @@ public: void usage(); private: + void usageOptions(const std::list<Option> &options, unsigned int indent); + std::list<Option> options_; std::map<unsigned int, Option *> optionsMap_; }; |