diff --git a/include/argparse.h b/include/argparse.h index 1671bcef..a97852ee 100644 --- a/include/argparse.h +++ b/include/argparse.h @@ -65,6 +65,11 @@ namespace argparse using runtime_error::runtime_error; }; + inline auto operator|(Handle lhs, Handle rhs) -> Handle + { + return static_cast(static_cast(lhs) & static_cast(rhs)); + } + inline auto operator&(Handle lhs, Handle rhs) -> int { return static_cast(lhs) & static_cast(rhs); diff --git a/tutorial/readme.md b/tutorial/readme.md index 731079e7..91e30deb 100644 --- a/tutorial/readme.md +++ b/tutorial/readme.md @@ -1169,6 +1169,7 @@ Some things to note here: * only version (`argparse::Handle::version`), * only errors (`argparse::Handle::errors`), * both help and errors (`argparse::Handle::errors_and_help`), + * any combination just like with bit masks (`argparse::Handle::errors | argparse::Handle::help`), * help, version, and errors (`argparse::Handle::errors_help_version`) which is the default. ## Conclusion