namespace command {
/**
* Class responsible for handling commandline options.
- * Options are non-required, named parameters of program.
+ * Options are named parameters of program.
*
* Example:
* ./myprog OptionName=OptionValue
*/
OptionType value;
- /** Variable indicating if current Option was already used or not */
- bool used = false;
-
public:
/**
* Default constructor.
virtual bool understand(const std::string & argv)
throw(std::invalid_argument) {
- if ((!used) && (argv.find(name) == 0)) {
+ if ((!isUsed()) && (argv.find(name) == 0)) {
std::size_t pos = argv.find("=");
if (pos != name.size()) {
* Current Option name
*/
const OptionName name;
-
- /** Variable indicating if current Option was already used or not */
- bool used = false;
-
public:
/**
* Default constructor.
* used to check against next value.
*/
virtual bool understand(const std::string & argv) {
- if ((!used) &&
+ if ((!isUsed()) &&
(argv == name)) {
used = true;
return true;