Fix compilation, remove some warnings.
[command.git] / include / option.h
index fe0fc857ddf54cc6ee745cd6506174b112dbd027..be65e772d06a6f42a868558d7d91002855e94d74 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <string>
 
-#include "argument.h"
+#include "parameter.h"
 
 namespace command {
     /**
@@ -15,9 +15,7 @@ namespace command {
      */
     template<typename OptionType>
     class Option
-        : Argument<OptionType> {
-    public:
-//         typedef typename Argument<OptionType, Lambda>::FunctionType FunctionType;
+        : public Parameter, public Callable<OptionType>  {
     protected:
         /**
          * Option name
@@ -33,11 +31,20 @@ namespace command {
          * @param function Function used to handle current Option.
          */
         Option(std::string name, std::string description, void (*function)(OptionType))
-            : name(name), Argument<OptionType>(description, function) {
+            : Parameter(description), Callable<OptionType>(function), name(name) {
         }
         virtual ~Option() { }
 
         virtual void handle() {
+            this->call(std::string("O"));
+        }
+
+        virtual bool understand(const std::string & argVal) {
+            if (argVal.find(name) != std::string::npos) {
+                return true;
+            }
+
+            return false;
         }
     };
 }