mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: Added ::getCommand
This commit is contained in:
parent
518389ec58
commit
f44194d54d
2 changed files with 11 additions and 0 deletions
10
src/CLI.cpp
10
src/CLI.cpp
|
@ -260,6 +260,16 @@ bool CLI::canonicalize (
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
std::string CLI::getCommand () const
|
||||||
|
{
|
||||||
|
for (const auto& a : _args)
|
||||||
|
if (a.hasTag ("CMD"))
|
||||||
|
return a.attribute ("canonical");
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
const std::string CLI::dump (const std::string& title) const
|
const std::string CLI::dump (const std::string& title) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
void add (const std::string&);
|
void add (const std::string&);
|
||||||
void analyze ();
|
void analyze ();
|
||||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||||
|
std::string getCommand () const;
|
||||||
const std::string dump (const std::string& title = "CLI Parser") const;
|
const std::string dump (const std::string& title = "CLI Parser") const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue