Skip to content

Commit

Permalink
feat: Add CPLIB_STARTUP_TEXT macro
Browse files Browse the repository at this point in the history
  • Loading branch information
yzy-1 committed Aug 2, 2024
1 parent 44c4dfc commit ad9226f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 1 addition & 3 deletions include/checker.i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ constexpr std::string_view ARGS_USAGE =

inline auto print_help_message(std::string_view program_name) -> void {
std::string msg =
format("cplib (CPLib) " CPLIB_VERSION
"\n"
"https://github.com/rindag-devs/cplib/ by Rindag Devs, copyright(c) 2023\n"
format(CPLIB_STARTUP_TEXT
"\n"
"Usage:\n"
" %s %s\n"
Expand Down
4 changes: 1 addition & 3 deletions include/generator.i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ inline auto parse_arg(std::string_view arg) -> std::pair<std::string, std::optio

inline auto print_help_message(std::string_view program_name, std::string_view args_usage) -> void {
std::string msg =
format("cplib (CPLib) " CPLIB_VERSION
"\n"
"https://github.com/rindag-devs/cplib/ by Rindag Devs, copyright(c) 2023\n"
format(CPLIB_STARTUP_TEXT
"\n"
"Usage:\n"
" %s %s\n"
Expand Down
4 changes: 1 addition & 3 deletions include/interactor.i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ constexpr std::string_view ARGS_USAGE = "<input_file> [--report-format={auto|jso

inline auto print_help_message(std::string_view program_name) -> void {
std::string msg =
format("cplib (CPLib) " CPLIB_VERSION
"\n"
"https://github.com/rindag-devs/cplib/ by Rindag Devs, copyright(c) 2023\n"
format(CPLIB_STARTUP_TEXT
"\n"
"Usage:\n"
" %s %s\n"
Expand Down
5 changes: 5 additions & 0 deletions include/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

#define CPLIB_VERSION "0.0.1-SNAPSHOT"

#define CPLIB_STARTUP_TEXT \
"cplib (CPLib) " CPLIB_VERSION \
"\n" \
"https://github.com/rindag-devs/cplib/ by Rindag Devs, copyright(c) 2023\n"

#if (_WIN32 || __WIN32__ || __WIN32 || _WIN64 || __WIN64__ || __WIN64 || WINNT || __WINNT || \
__WINNT__ || __CYGWIN__)
#if !defined(_MSC_VER) || _MSC_VER > 1400
Expand Down
5 changes: 1 addition & 4 deletions include/validator.i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,7 @@ constexpr std::string_view ARGS_USAGE = "[<input_file>] [--report-format={auto|j

inline auto print_help_message(std::string_view program_name) -> void {
std::string msg =
format("cplib (CPLib) " CPLIB_VERSION
"\n"
"https://github.com/rindag-devs/cplib/ by Rindag Devs, copyright(c) 2023\n"
"\n"
format(CPLIB_STARTUP_TEXT
"Usage:\n"
" %s %s\n"
"\n"
Expand Down

0 comments on commit ad9226f

Please sign in to comment.