X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fgetopt.h;h=8d78a728169a74e2b5715fce27ee63bccd100cc0;hp=411515f5dd9c1d837e47131ca3c2ee1d08f21e91;hb=c3e242c2629cbc9645258b30aaf07b7285d4372b;hpb=b54e273fec47af51792955143e84417b638ad2b7 diff --git a/source/core/getopt.h b/source/core/getopt.h index 411515f..8d78a72 100644 --- a/source/core/getopt.h +++ b/source/core/getopt.h @@ -6,6 +6,7 @@ #include #include #include +#include "noncopyable.h" namespace Msp { @@ -58,7 +59,7 @@ A built-in --help option is provided and will output a list of options, arguments and their associated help texts. An application may override this by providing its own option with the same name. */ -class GetOpt +class GetOpt: private NonCopyable { public: enum ArgType @@ -272,8 +273,10 @@ private: unsigned process_short(const char *const *); public: - /** Generates a single line that describes known options and arguments. */ - std::string generate_usage(const std::string &) const; + /** Generates a single line that describes known options and arguments. If + compact is true, the options list is replaced with a placeholder. This + provides cleaner output if full help text is printed. */ + std::string generate_usage(const std::string &, bool compact = false) const; /** Generates help for known options and arguments in tabular format, one item per line. The returned string will have a linefeed at the end. */