diff --git a/cmdopt2/args.cpp b/cmdopt2/args.cpp index 5a1fdf6f..ac2de44f 100644 --- a/cmdopt2/args.cpp +++ b/cmdopt2/args.cpp @@ -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; } \ No newline at end of file diff --git a/cmdopt2/args.hpp b/cmdopt2/args.hpp index a642d106..758dfe2c 100644 --- a/cmdopt2/args.hpp +++ b/cmdopt2/args.hpp @@ -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;