mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: Renamed variable for clarity
This commit is contained in:
parent
649329e570
commit
dda28637e2
1 changed files with 8 additions and 6 deletions
14
src/CLI.cpp
14
src/CLI.cpp
|
@ -332,7 +332,7 @@ std::string CLI::dump (const std::string& title) const
|
||||||
// Scan all arguments and canonicalize names that need it.
|
// Scan all arguments and canonicalize names that need it.
|
||||||
void CLI::canonicalizeNames ()
|
void CLI::canonicalizeNames ()
|
||||||
{
|
{
|
||||||
bool alreadyFoundArg = false;
|
bool alreadyFoundCmd = false;
|
||||||
|
|
||||||
for (auto& a : _args)
|
for (auto& a : _args)
|
||||||
{
|
{
|
||||||
|
@ -340,29 +340,31 @@ void CLI::canonicalizeNames ()
|
||||||
std::string canonical = raw;
|
std::string canonical = raw;
|
||||||
|
|
||||||
// Commands.
|
// Commands.
|
||||||
if (! alreadyFoundArg &&
|
if (! alreadyFoundCmd &&
|
||||||
(exactMatch ("command", raw) ||
|
(exactMatch ("command", raw) ||
|
||||||
canonicalize (canonical, "command", raw)))
|
canonicalize (canonical, "command", raw)))
|
||||||
{
|
{
|
||||||
a.attribute ("canonical", canonical);
|
a.attribute ("canonical", canonical);
|
||||||
a.tag ("CMD");
|
a.tag ("CMD");
|
||||||
alreadyFoundArg = true;
|
alreadyFoundCmd = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hints.
|
// Hints.
|
||||||
else if (exactMatch ("hint", raw) ||
|
else if (exactMatch ("hint", raw) ||
|
||||||
canonicalize (canonical, "hint", raw))
|
canonicalize (canonical, "hint", raw))
|
||||||
{
|
{
|
||||||
a.attribute ("canonical", canonical);
|
a.attribute ("canonical", canonical);
|
||||||
a.tag ("HINT");
|
a.tag ("HINT");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extensions.
|
// Extensions.
|
||||||
else if (exactMatch ("extension", raw) ||
|
else if (! alreadyFoundCmd &&
|
||||||
canonicalize (canonical, "extension", raw))
|
(exactMatch ("extension", raw) ||
|
||||||
|
canonicalize (canonical, "extension", raw)))
|
||||||
{
|
{
|
||||||
a.attribute ("canonical", canonical);
|
a.attribute ("canonical", canonical);
|
||||||
a.tag ("EXT");
|
a.tag ("EXT");
|
||||||
|
alreadyFoundCmd = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue