cmdopt: add null option

This commit is contained in:
Danny Robson 2015-06-30 22:06:10 +10:00
parent 7f8dab5db3
commit 42fffeea46
2 changed files with 31 additions and 0 deletions

View File

@ -117,6 +117,28 @@ base::seen (bool _seen)
///////////////////////////////////////////////////////////////////////////////
null::null (std::string _name):
base (std::move (_name))
{ ; }
//-----------------------------------------------------------------------------
void
null::execute (void)
{
seen (true);
}
//-----------------------------------------------------------------------------
void
null::execute (const char *restrict)
{
seen (true);
}
//-----------------------------------------------------------------------------
namespace util { namespace cmdopt { namespace option {
template class value<uint16_t>;
template class value<uint32_t>;

View File

@ -51,6 +51,15 @@ namespace util { namespace cmdopt {
};
class null : public base {
public:
null (std::string name);
virtual void execute (void) override;
virtual void execute (const char *restrict) override;
};
template <typename T>
class value : public base {
public: