cmdopt2/args: add acceptor builder
This commit is contained in:
parent
577d34eeb5
commit
1e1034711f
@ -95,4 +95,14 @@ keyword::present (bool &val) const
|
||||
keyword res = *this;
|
||||
res.acceptor0 = [&val] (void) { val = true; };
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
keyword
|
||||
keyword::acceptor (acceptor0_t _acceptor)
|
||||
{
|
||||
keyword res = *this;
|
||||
res.acceptor0 = _acceptor;
|
||||
return res;
|
||||
}
|
@ -67,6 +67,14 @@ namespace cruft::cmdopt2 {
|
||||
{
|
||||
return reinterpret_cast<BaseT const&> (*this);
|
||||
}
|
||||
|
||||
BaseT
|
||||
acceptor (acceptor1_t _acceptor) const
|
||||
{
|
||||
BaseT res = get ();
|
||||
res.acceptor1 = _acceptor;
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -88,6 +96,9 @@ namespace cruft::cmdopt2 {
|
||||
static keyword create (std::string const &name);
|
||||
static keyword create (std::string &&name);
|
||||
|
||||
using ops::acceptor;
|
||||
keyword acceptor (acceptor0_t);
|
||||
|
||||
keyword flag (void) const;
|
||||
keyword flag (std::string_view long_) const;
|
||||
keyword flag (char short_) const;
|
||||
|
Loading…
Reference in New Issue
Block a user