瀏覽代碼

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)                                               \