]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/getopt.h
Allow seen_count to be bound to a variable for dealing with optional arguments
[libs/core.git] / source / core / getopt.h
index dbc0f9cef0284e94d4f5ec66b890e94700515e4d..2aaceef836730aa24a966c3cfaa20bb9864e23a7 100644 (file)
@@ -72,6 +72,8 @@ public:
                metavariable is used to denote the argument in the option list. */
                virtual Option &set_help(const std::string &, const std::string &) = 0;
 
+               virtual Option &bind_seen_count(unsigned &) = 0;
+
                /// Returns the number of times this option was seen on the command line.
                virtual unsigned get_seen_count() const = 0;
        };
@@ -84,6 +86,7 @@ private:
                std::string lng;
                ArgType arg_type;
                unsigned seen_count;
+               unsigned *ext_seen_count;
                std::string help;
                std::string metavar;
 
@@ -93,6 +96,7 @@ private:
 
                virtual OptBase &set_help(const std::string &);
                virtual OptBase &set_help(const std::string &, const std::string &);
+               virtual OptBase &bind_seen_count(unsigned &);
                char get_short() const { return shrt; }
                const std::string &get_long() const { return lng; }
                ArgType get_arg_type() const { return arg_type; }