Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/commands/wpm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3169,6 +3169,9 @@ auto print_usage() -> int {
" export [--plain] print installed package names for "
"profiles\n"
" restore <file> install packages from a plain list\n"
" outdated list installed packages with updates\n"
" uninstall|remove|erase <package>...\n"
" uninstall one or more packages\n"
" update|upgrade winuxcmd update WinuxCmd from local index\n\n"
"Options:\n"
" -r, --root <dir> manage a specific WinuxCmd root\n"
Expand Down
17 changes: 13 additions & 4 deletions src/core/cmd_meta.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,20 @@ export auto format_custom_help(std::string_view name, std::string_view help)
std::string_view content = indented ? line.substr(indent) : line;

if (first_line) {
const size_t separator = content.find_first_of("::");
const size_t ascii_separator = content.find(':');
const size_t utf8_separator = content.find(":");
size_t separator = ascii_separator;
size_t separator_size = 1;
if (utf8_separator != std::string_view::npos &&
(separator == std::string_view::npos ||
utf8_separator < separator)) {
separator = utf8_separator;
separator_size = std::string_view(":").size();
}
if (separator != std::string_view::npos) {
append_styled(result, content.substr(0, separator + 1), section_style,
color);
result.append(content.substr(separator + 1));
append_styled(result, content.substr(0, separator + separator_size),
section_style, color);
result.append(content.substr(separator + separator_size));
} else {
append_styled(result, content, title_style, color);
}
Expand Down