mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Docs/CLI2: Additional dev docs for applyOverrides
This commit is contained in:
parent
279c825033
commit
0d682ee7a9
1 changed files with 7 additions and 0 deletions
|
@ -277,16 +277,23 @@ void CLI2::applyOverrides (int argc, const char** argv)
|
|||
{
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
|
||||
// Don't process any arguments after a '--'
|
||||
std::string raw = argv[i];
|
||||
if (raw == "--")
|
||||
break;
|
||||
|
||||
// Overrides always start with 'rc.'
|
||||
if (raw.length () > 3 &&
|
||||
raw.substr (0, 3) == "rc.")
|
||||
{
|
||||
|
||||
// Our separator can either be '=' or ':', so try and find both.
|
||||
auto sep = raw.find ('=', 3);
|
||||
if (sep == std::string::npos)
|
||||
sep = raw.find (':', 3);
|
||||
|
||||
// Process our override if well-formed
|
||||
if (sep != std::string::npos)
|
||||
{
|
||||
std::string name = raw.substr (3, sep - 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue