cmdopt2/args: add ignore
helper
This commit is contained in:
parent
8a38459f9a
commit
a63f4fef44
@ -22,6 +22,16 @@ positional::create (std::string &&name)
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
positional
|
||||
positional::ignore (void) const
|
||||
{
|
||||
positional res = *this;
|
||||
res.acceptor1.reset ();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
keyword
|
||||
keyword::create (char const *name)
|
||||
@ -105,4 +115,15 @@ keyword::acceptor (acceptor0_t _acceptor)
|
||||
keyword res = *this;
|
||||
res.acceptor0 = _acceptor;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
keyword
|
||||
keyword::ignore (void) const
|
||||
{
|
||||
keyword res = *this;
|
||||
res.acceptor0.reset ();
|
||||
res.acceptor1.reset ();
|
||||
return res;
|
||||
}
|
@ -84,6 +84,8 @@ namespace cruft::cmdopt2 {
|
||||
static positional create (std::string const &name);
|
||||
static positional create (std::string &&name);
|
||||
|
||||
positional ignore (void) const;
|
||||
|
||||
int count = 1;
|
||||
};
|
||||
|
||||
@ -99,6 +101,8 @@ namespace cruft::cmdopt2 {
|
||||
using ops::acceptor;
|
||||
keyword acceptor (acceptor0_t);
|
||||
|
||||
keyword ignore (void) const;
|
||||
|
||||
keyword flag (void) const;
|
||||
keyword flag (std::string_view long_) const;
|
||||
keyword flag (char short_) const;
|
||||
|
Loading…
Reference in New Issue
Block a user