Service Menu: afegides opcions per als mandos

This commit is contained in:
2025-08-05 13:12:48 +02:00
parent 12e3226f17
commit 3bb5e5d604
7 changed files with 89 additions and 4 deletions

View File

@@ -383,4 +383,16 @@ auto getFileName(const std::string &path) -> std::string {
auto getPath(const std::string &full_path) -> std::string {
std::filesystem::path path(full_path);
return path.parent_path().string();
}
// Trunca un string y le añade puntos suspensivos
auto truncateWithEllipsis(const std::string &input, size_t length) -> std::string {
if (input.size() <= length) {
return input;
}
if (length <= 3) {
// Not enough space for any content plus ellipsis
return std::string(length, '.');
}
return input.substr(0, length) + "...";
}