forked from lix-project/lix
Completions::add use libutil trim()
This commit is contained in:
parent
a537095e1f
commit
30edd7af53
|
@ -29,8 +29,7 @@ void Args::removeFlag(const std::string & longName)
|
||||||
|
|
||||||
void Completions::add(std::string completion, std::string description)
|
void Completions::add(std::string completion, std::string description)
|
||||||
{
|
{
|
||||||
// strip whitespace/empty lines from the front of the description
|
description = trim(description);
|
||||||
description.erase(0, description.find_first_not_of(" \t\n"));
|
|
||||||
// ellipsize overflowing content on the back of the description
|
// ellipsize overflowing content on the back of the description
|
||||||
auto end_index = description.find_first_of(".\n");
|
auto end_index = description.find_first_of(".\n");
|
||||||
if (end_index != std::string::npos) {
|
if (end_index != std::string::npos) {
|
||||||
|
|
Loading…
Reference in a new issue