mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI: Cleaned up overly complex use of 'terminated'.
This commit is contained in:
parent
27cb2afe2c
commit
61470d7820
1 changed files with 4 additions and 8 deletions
12
src/CLI.cpp
12
src/CLI.cpp
|
@ -250,16 +250,14 @@ void CLI::getDataLocation (int argc, const char** argv, Path& data)
|
|||
if (location != "")
|
||||
data = location;
|
||||
|
||||
bool terminated = false;
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
std::string raw = argv[i];
|
||||
|
||||
if (raw == "--")
|
||||
terminated = true;
|
||||
break;
|
||||
|
||||
if (! terminated &&
|
||||
raw.length () > 17 &&
|
||||
if (raw.length () > 17 &&
|
||||
raw.substr (0, 16) == "rc.data.location")
|
||||
{
|
||||
data = Directory (raw.substr (17));
|
||||
|
@ -274,16 +272,14 @@ void CLI::getDataLocation (int argc, const char** argv, Path& data)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CLI::applyOverrides (int argc, const char** argv)
|
||||
{
|
||||
bool terminated = false;
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
std::string raw = argv[i];
|
||||
|
||||
if (raw == "--")
|
||||
terminated = true;
|
||||
break;
|
||||
|
||||
if (! terminated &&
|
||||
raw.length () > 3 &&
|
||||
if (raw.length () > 3 &&
|
||||
raw.substr (0, 3) == "rc.")
|
||||
{
|
||||
auto sep = raw.find ('=', 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue