1
0

fix: fix clap manual output error.

- fix the issue that the executable in clap manual output is full path, not the file name.
This commit is contained in:
2026-02-02 16:18:42 +08:00
parent 9ad199073a
commit c19561cb54

View File

@@ -5,6 +5,7 @@
#include "../../patch/libcxx/enumerate.hpp"
#include "../../string/op.hpp"
#include "../../env.hpp"
#include <filesystem>
#include <ranges>
#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();