mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TW-1300
- TW-1300 _get could use return codes (thanks to Scott Kostyshak).
This commit is contained in:
parent
32272addd0
commit
501194abfa
6 changed files with 107 additions and 5 deletions
|
@ -52,17 +52,23 @@ int CmdGet::execute (std::string& output)
|
|||
if (words.size () == 0)
|
||||
throw std::string (STRING_CMD_GET_NO_DOM);
|
||||
|
||||
bool found = false;
|
||||
std::vector <std::string> results;
|
||||
std::vector <std::string>::iterator word;
|
||||
for (word = words.begin (); word != words.end (); ++word)
|
||||
{
|
||||
Task t;
|
||||
results.push_back (context.dom.get (*word, t));
|
||||
std::string result = context.dom.get (*word, t);
|
||||
results.push_back (result);
|
||||
|
||||
if (result != "" &&
|
||||
result != *word)
|
||||
found = true;
|
||||
}
|
||||
|
||||
join (output, " ", results);
|
||||
output += "\n";
|
||||
return 0;
|
||||
return found ? 0 : 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue