mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI
- Reorganized methods to match header sequence.
This commit is contained in:
parent
6d64472826
commit
7812bce079
1 changed files with 27 additions and 28 deletions
55
src/CLI.cpp
55
src/CLI.cpp
|
@ -91,34 +91,8 @@ void CLI::add (const std::string& arg)
|
||||||
extractOverrides ();
|
extractOverrides ();
|
||||||
aliasExpansion ();
|
aliasExpansion ();
|
||||||
categorize ();
|
categorize ();
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
dump ("CLI::add");
|
||||||
void CLI::extractOverrides ()
|
|
||||||
{
|
|
||||||
std::vector <std::string> reconstructed;
|
|
||||||
|
|
||||||
std::vector <std::string>::iterator i;
|
|
||||||
for (i = _args.begin (); i != _args.end (); ++i)
|
|
||||||
{
|
|
||||||
if (i->find ("rc:") == 0)
|
|
||||||
{
|
|
||||||
_rc = i->substr (3);
|
|
||||||
}
|
|
||||||
else if (i->find ("rc.") == 0)
|
|
||||||
{
|
|
||||||
std::string::size_type sep = i->find ('=', 3);
|
|
||||||
if (sep == std::string::npos)
|
|
||||||
sep = i->find (':', 3);
|
|
||||||
if (sep != std::string::npos)
|
|
||||||
_overrides[i->substr (3, sep - 3)] = i->substr (sep + 1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
reconstructed.push_back (*i);
|
|
||||||
}
|
|
||||||
|
|
||||||
_args = reconstructed;
|
|
||||||
dump ("CLI::extractOverrides");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -152,8 +126,33 @@ void CLI::aliasExpansion ()
|
||||||
_args = reconstructed;
|
_args = reconstructed;
|
||||||
}
|
}
|
||||||
while (action && counter++ < safetyValveDefault);
|
while (action && counter++ < safetyValveDefault);
|
||||||
|
}
|
||||||
|
|
||||||
dump ("CLI::aliasExpansion");
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void CLI::extractOverrides ()
|
||||||
|
{
|
||||||
|
std::vector <std::string> reconstructed;
|
||||||
|
|
||||||
|
std::vector <std::string>::iterator i;
|
||||||
|
for (i = _args.begin (); i != _args.end (); ++i)
|
||||||
|
{
|
||||||
|
if (i->find ("rc:") == 0)
|
||||||
|
{
|
||||||
|
_rc = i->substr (3);
|
||||||
|
}
|
||||||
|
else if (i->find ("rc.") == 0)
|
||||||
|
{
|
||||||
|
std::string::size_type sep = i->find ('=', 3);
|
||||||
|
if (sep == std::string::npos)
|
||||||
|
sep = i->find (':', 3);
|
||||||
|
if (sep != std::string::npos)
|
||||||
|
_overrides[i->substr (3, sep - 3)] = i->substr (sep + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
reconstructed.push_back (*i);
|
||||||
|
}
|
||||||
|
|
||||||
|
_args = reconstructed;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue