mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdGet: Implemented 'get' command for one DOM ref
This commit is contained in:
parent
9250be3e72
commit
92731c889c
2 changed files with 16 additions and 5 deletions
|
@ -14,6 +14,7 @@ set (timew_SRCS CLI.cpp CLI.h
|
|||
Range.cpp Range.h
|
||||
Rules.cpp Rules.h
|
||||
data.cpp
|
||||
dom.cpp
|
||||
init.cpp
|
||||
helper.cpp
|
||||
log.cpp
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <cmake.h>
|
||||
#include <commands.h>
|
||||
#include <timew.h>
|
||||
#include <format.h>
|
||||
#include <iostream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -35,14 +36,23 @@ int CmdGet (
|
|||
Rules& rules,
|
||||
Database& database)
|
||||
{
|
||||
// TODO Join results together with spaces.
|
||||
|
||||
// Іdentify DOM references in cli.
|
||||
/*
|
||||
for (each DOM reference in cli)
|
||||
for (auto& arg : cli._args)
|
||||
{
|
||||
std::string value;
|
||||
domGet (database, reference, value);
|
||||
if (arg.hasTag ("TAG") &&
|
||||
arg.hasTag ("FILTER"))
|
||||
{
|
||||
std::string reference = arg.attribute ("raw");
|
||||
std::string value;
|
||||
if (! domGet (database, reference, value))
|
||||
throw format ("DOM reference '{1}' is not valid.", reference);
|
||||
|
||||
std::cout << value << '\n';
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue