diff --git a/src/commands/CmdIDs.cpp b/src/commands/CmdIDs.cpp index 723534710..e934fb2d4 100644 --- a/src/commands/CmdIDs.cpp +++ b/src/commands/CmdIDs.cpp @@ -96,12 +96,8 @@ int CmdCompletionIds::execute (std::string& output) ids.push_back (task->id); std::sort (ids.begin (), ids.end ()); - std::stringstream out; - std::vector ::iterator id; - for (id = ids.begin (); id != ids.end (); ++id) - out << *id << "\n"; - - output = out.str (); + join (output, "\n", ids); + output += "\n"; return 0; } @@ -162,6 +158,7 @@ int CmdUUIDs::execute (std::string& output) for (task = filtered.begin (); task != filtered.end (); ++task) uuids.push_back (task->get ("uuid")); + std::sort (uuids.begin (), uuids.end ()); join (output, ",", uuids); output += "\n"; return 0; @@ -191,6 +188,7 @@ int CmdCompletionUuids::execute (std::string& output) for (task = filtered.begin (); task != filtered.end (); ++task) uuids.push_back (task->get ("uuid")); + std::sort (uuids.begin (), uuids.end ()); join (output, "\n", uuids); output += "\n"; return 0; diff --git a/src/en-US.h b/src/en-US.h index 261b3b738..e9a2754c8 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -218,7 +218,7 @@ #define STRING_CMD_LOG_NO_WAITING "You cannot log waiting tasks." #define STRING_CMD_LOG_LOGGED "Logged task." #define STRING_CMD_IDS_USAGE_RANGE "Shows the IDs of matching tasks, as a range" -#define STRING_CMD_IDS_USAGE_LIST "Shows only the IDs of matching tasks, in the form of a list" +#define STRING_CMD_IDS_USAGE_LIST "Shows the IDs of matching tasks, in the form of a list" #define STRING_CMD_IDS_USAGE_ZSH "Shows the IDs and descriptions of matching tasks" #define STRING_CMD_UUIDS_USAGE_RANGE "Shows the UUIDs of matching tasks, as a comma-separated list" #define STRING_CMD_UUIDS_USAGE_LIST "Shows the UUIDs of matching tasks, as a list"