فهرست منبع

refactor: show usage instead of throwing on missing action

Sam Jaffe 2 سال پیش
والد
کامیت
39c21e8885
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  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)                                               \