mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Enhancements
- Added text.cpp/ucFirst function to capitalize words, so that "pending" can now appear as "Pending" on the info report. This helps task pass many more test cases.
This commit is contained in:
parent
7a2c40626e
commit
78ec411067
3 changed files with 13 additions and 1 deletions
|
@ -309,7 +309,7 @@ std::string handleInfo ()
|
||||||
table.addCell (row, 0, "ID");
|
table.addCell (row, 0, "ID");
|
||||||
table.addCell (row, 1, task->id);
|
table.addCell (row, 1, task->id);
|
||||||
|
|
||||||
std::string status = Task::statusToText (task->getStatus ());
|
std::string status = ucFirst (Task::statusToText (task->getStatus ()));
|
||||||
|
|
||||||
if (task->has ("parent"))
|
if (task->has ("parent"))
|
||||||
status += " (Recurring)";
|
status += " (Recurring)";
|
||||||
|
|
11
src/text.cpp
11
src/text.cpp
|
@ -296,6 +296,17 @@ std::string upperCase (const std::string& input)
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::string ucFirst (const std::string& input)
|
||||||
|
{
|
||||||
|
std::string output = input;
|
||||||
|
|
||||||
|
if (output.length () > 0)
|
||||||
|
output[0] = ::toupper (output[0]);
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const char* optionalBlankLine ()
|
const char* optionalBlankLine ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,7 @@ void join (std::string&, const std::string&, const std::vector<std::string>&);
|
||||||
std::string commify (const std::string&);
|
std::string commify (const std::string&);
|
||||||
std::string lowerCase (const std::string&);
|
std::string lowerCase (const std::string&);
|
||||||
std::string upperCase (const std::string&);
|
std::string upperCase (const std::string&);
|
||||||
|
std::string ucFirst (const std::string&);
|
||||||
const char* optionalBlankLine ();
|
const char* optionalBlankLine ();
|
||||||
void guess (const std::string&, std::vector<std::string>&, std::string&);
|
void guess (const std::string&, std::vector<std::string>&, std::string&);
|
||||||
bool digitsOnly (const std::string&);
|
bool digitsOnly (const std::string&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue