mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-06-26 10:54:29 +02:00
Review: Improving use of white space.
This commit is contained in:
parent
a4a46dba47
commit
4c052c5a95
1 changed files with 38 additions and 11 deletions
|
@ -81,7 +81,7 @@ static void editTask (const std::string& uuid)
|
||||||
|
|
||||||
command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " modify reviewed:now";
|
command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " modify reviewed:now";
|
||||||
system (command.c_str ());
|
system (command.c_str ());
|
||||||
std::cout << STRING_REVIEW_MODIFIED << "\n";
|
std::cout << STRING_REVIEW_MODIFIED << "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -89,7 +89,7 @@ static void reviewTask (const std::string& uuid)
|
||||||
{
|
{
|
||||||
std::string command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " modify reviewed:now";
|
std::string command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " modify reviewed:now";
|
||||||
system (command.c_str ());
|
system (command.c_str ());
|
||||||
std::cout << STRING_REVIEW_REVIEWED << "\n";
|
std::cout << STRING_REVIEW_REVIEWED << "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -97,7 +97,7 @@ static void completeTask (const std::string& uuid)
|
||||||
{
|
{
|
||||||
std::string command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " done";
|
std::string command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " done";
|
||||||
system (command.c_str ());
|
system (command.c_str ());
|
||||||
std::cout << STRING_REVIEW_COMPLETED << "\n";
|
std::cout << STRING_REVIEW_COMPLETED << "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -105,7 +105,24 @@ static void deleteTask (const std::string& uuid)
|
||||||
{
|
{
|
||||||
std::string command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " delete";
|
std::string command = "task rc.confirmation:no rc.verbose:nothing " + uuid + " delete";
|
||||||
system (command.c_str ());
|
system (command.c_str ());
|
||||||
std::cout << STRING_REVIEW_DELETED << "\n";
|
std::cout << STRING_REVIEW_DELETED << "\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
static const std::string reviewNothing (
|
||||||
|
unsigned int width)
|
||||||
|
{
|
||||||
|
return "\nThere are no tasks needing review.\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
static const std::string reviewStart (
|
||||||
|
unsigned int total,
|
||||||
|
unsigned int width)
|
||||||
|
{
|
||||||
|
return "\none\n"
|
||||||
|
"two\n"
|
||||||
|
"three\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -147,6 +164,14 @@ static void reviewLoop (const std::vector <std::string>& uuids)
|
||||||
auto total = uuids.size ();
|
auto total = uuids.size ();
|
||||||
auto width = getWidth ();
|
auto width = getWidth ();
|
||||||
|
|
||||||
|
if (total == 0)
|
||||||
|
{
|
||||||
|
std::cout << reviewNothing (width);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << reviewStart (total, width);
|
||||||
|
|
||||||
unsigned int current = 0;
|
unsigned int current = 0;
|
||||||
while (current < total)
|
while (current < total)
|
||||||
{
|
{
|
||||||
|
@ -174,7 +199,7 @@ static void reviewLoop (const std::vector <std::string>& uuids)
|
||||||
else if (response == "c") { completeTask (uuid); ++current; }
|
else if (response == "c") { completeTask (uuid); ++current; }
|
||||||
else if (response == "d") { deleteTask (uuid); ++current; }
|
else if (response == "d") { deleteTask (uuid); ++current; }
|
||||||
else if (response == "q") { break; }
|
else if (response == "q") { break; }
|
||||||
else if (response == "") { std::cout << "Skipped\n"; ++current; }
|
else if (response == "") { std::cout << "Skipped\n\n"; ++current; }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << format (STRING_REVIEW_UNRECOGNIZED, response) << "\n";
|
std::cout << format (STRING_REVIEW_UNRECOGNIZED, response) << "\n";
|
||||||
|
@ -184,7 +209,9 @@ static void reviewLoop (const std::vector <std::string>& uuids)
|
||||||
// nothing but advance to the next task.
|
// nothing but advance to the next task.
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << format (STRING_REVIEW_END, tasks, total) << "\n";
|
std::cout << "\n"
|
||||||
|
<< format (STRING_REVIEW_END, tasks, total)
|
||||||
|
<< "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue