mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI2: Added ::getToken method for obtaining the canonical form, if possible
This commit is contained in:
parent
9db73962da
commit
7432c0aead
2 changed files with 11 additions and 0 deletions
10
src/CLI2.cpp
10
src/CLI2.cpp
|
@ -137,6 +137,16 @@ const std::string A2::attribute (const std::string& name) const
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
const std::string A2::getToken () const
|
||||||
|
{
|
||||||
|
auto i = _attributes.find ("canonical");
|
||||||
|
if (i == _attributes.end ())
|
||||||
|
i = _attributes.find ("raw");
|
||||||
|
|
||||||
|
return i->second;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const std::string A2::dump () const
|
const std::string A2::dump () const
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
void attribute (const std::string&, const std::string&);
|
void attribute (const std::string&, const std::string&);
|
||||||
void attribute (const std::string&, const int);
|
void attribute (const std::string&, const int);
|
||||||
const std::string attribute (const std::string&) const;
|
const std::string attribute (const std::string&) const;
|
||||||
|
const std::string getToken () const;
|
||||||
const std::string dump () const;
|
const std::string dump () const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue