Browse Source

refactor: show usage instead of throwing on missing action

Sam Jaffe 2 years ago
parent
commit
39c21e8885
1 changed files with 2 additions and 1 deletions
  1. 2 1
      include/program_args/arguments.h

+ 2 - 1
include/program_args/arguments.h

@@ -267,7 +267,8 @@ int typed_main(Args const &, Actions const &...);
     tname const & self = static_cast<tname const &>(*this);                    \
     BOOST_PP_SEQ_FOR_EACH(TRY_INVOKE, _,                                       \
                           BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))               \
-    throw program::ProgramArgumentsError("no valid action provided");          \
+    usage();                                                                   \
+    return 1;                                                                  \
   }
 
 #define PROGRAM_ARGS_MAIN(tname)                                               \