From c19561cb540c063fb6df6d75cec1514a2844b02d Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Mon, 2 Feb 2026 16:18:42 +0800 Subject: [PATCH] fix: fix clap manual output error. - fix the issue that the executable in clap manual output is full path, not the file name. --- src/yycc/carton/clap/manual.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/yycc/carton/clap/manual.cpp b/src/yycc/carton/clap/manual.cpp index ebf03d6..2163bd6 100644 --- a/src/yycc/carton/clap/manual.cpp +++ b/src/yycc/carton/clap/manual.cpp @@ -5,6 +5,7 @@ #include "../../patch/libcxx/enumerate.hpp" #include "../../string/op.hpp" #include "../../env.hpp" +#include #include #define CLAP ::yycc::carton::clap @@ -112,8 +113,9 @@ namespace yycc::carton::clap::manual { // only print usage if we can fetch the name of executable auto executable = ENV::current_exe(); if (executable.has_value()) { + // Get the filename part and print TERMCOLOR::cprintln(trctx.usage_title, TERMCOLOR::Color::Yellow, TERMCOLOR::Color::Default, TERMCOLOR::Attribute::Default, dst); - dst << INDENT << FORMAT::format(trctx.usage_body, executable.value().u8string()) << std::endl; + dst << INDENT << FORMAT::format(trctx.usage_body, executable.value().filename().u8string()) << std::endl; } const auto &variables = app.get_variables();