From ea4d32ada5958ff51b93752f39e923a21b5290e9 Mon Sep 17 00:00:00 2001 From: Madman10K Date: Mon, 20 May 2024 23:00:47 +0300 Subject: [PATCH] CLI Parser 3.0 --- CLIParser.cpp | 3 ++- CMakeLists.txt | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CLIParser.cpp b/CLIParser.cpp index 121b238..af8577b 100644 --- a/CLIParser.cpp +++ b/CLIParser.cpp @@ -1,6 +1,7 @@ #include #include "CLIParser.hpp" #include +#include void UCLI::Parser::parse(int argc, char** argv, ArrayFlag* arrayFlags, size_t arrayFlagsSize, @@ -144,7 +145,7 @@ void UCLI::Parser::parseLongArgument(std::vector& args, uint8_t frontTrun Pair* pairs, size_t pairsSize, PairWithFunc* pairsWithFunc, size_t pairsWithFuncSize, bool bCheckShort) noexcept { - std::string currentTmp = tmp.substr(0, frontTruncate); + std::string currentTmp = tmp.substr(frontTruncate); FOR_EACH_WITH_CHECK(booleanFlags, booleanFlagsSize, a, { if (a.longType == currentTmp) diff --git a/CMakeLists.txt b/CMakeLists.txt index 088dbfc..3c334aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,10 +20,6 @@ add_library(UntitledCLIParser ${UCLI_LIBRARY_TYPE} C/cucli.cpp CLIParser.cpp ${U target_compile_definitions(UntitledCLIParser PRIVATE UVK_LOG_EXPORT_FROM_LIBRARY UVK_LIB_COMPILE) target_compile_definitions(UntitledCLIParser PUBLIC UIMGUI_CLI_PARSER_MODULE_ENABLED) list(APPEND compile_defs "UIMGUI_CLI_PARSER_MODULE_ENABLED") -if (WITH_UTF) - target_compile_definitions(UntitledCLIParser PUBLIC UCLI_COMPILE_WITH_UTF_SUPPORT) - list(APPEND compile_defs "UCLI_COMPILE_WITH_UTF_SUPPORT") -endif() configure_file(UntitledCLIParser.pc.in UntitledCLIParser.pc @ONLY)