mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdGet: Checks all references before emitting results
This commit is contained in:
parent
d8bfeea142
commit
14ca159df4
1 changed files with 5 additions and 4 deletions
|
@ -27,18 +27,18 @@
|
|||
#include <cmake.h>
|
||||
#include <commands.h>
|
||||
#include <timew.h>
|
||||
#include <shared.h>
|
||||
#include <format.h>
|
||||
#include <iostream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Іdentify DOM references in cli, provide space-separated results.
|
||||
int CmdGet (
|
||||
const CLI& cli,
|
||||
Rules& rules,
|
||||
Database& database)
|
||||
{
|
||||
// TODO Join results together with spaces.
|
||||
|
||||
// Іdentify DOM references in cli.
|
||||
std::vector <std::string> results;
|
||||
for (auto& arg : cli._args)
|
||||
{
|
||||
if (arg.hasTag ("TAG") &&
|
||||
|
@ -49,10 +49,11 @@ int CmdGet (
|
|||
if (! domGet (database, reference, value))
|
||||
throw format ("DOM reference '{1}' is not valid.", reference);
|
||||
|
||||
std::cout << value << '\n';
|
||||
results.push_back (value);
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << join (" ", results) << '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue