mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Bug #1038
- Cleaner solution (less code duplication and blank space only when a confirmation is needed) for bug #1038.
This commit is contained in:
parent
3bf9ebad62
commit
e5d142a468
13 changed files with 10 additions and 21 deletions
|
@ -1,6 +1,8 @@
|
|||
------ current release ---------------------------
|
||||
|
||||
2.2.0 ()
|
||||
|
||||
Bugs
|
||||
+ Fixed bug #1038, which prints blank lines with bulk changes and when the
|
||||
verbose attributes does not specify it. Lines do a better separation between
|
||||
each changes also.
|
||||
|
|
|
@ -119,8 +119,6 @@ int CmdAnnotate::execute (std::string& output)
|
|||
std::cout << STRING_CMD_ANNO_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -119,8 +119,6 @@ int CmdAppend::execute (std::string& output)
|
|||
std::cout << STRING_CMD_APPEND_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -143,8 +143,6 @@ int CmdDelete::execute (std::string& output)
|
|||
std::cout << STRING_CMD_DELETE_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -132,8 +132,6 @@ int CmdDenotate::execute (std::string& output)
|
|||
std::cout << STRING_CMD_DENO_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -120,8 +120,6 @@ int CmdDone::execute (std::string& output)
|
|||
<< "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -125,8 +125,6 @@ int CmdDuplicate::execute (std::string& output)
|
|||
std::cout << STRING_CMD_DUPLICATE_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -162,8 +162,6 @@ int CmdModify::execute (std::string& output)
|
|||
std::cout << STRING_CMD_MODIFY_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,8 +119,6 @@ int CmdPrepend::execute (std::string& output)
|
|||
std::cout << STRING_CMD_PREPEND_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -104,8 +104,6 @@ int CmdStart::execute (std::string& output)
|
|||
std::cout << STRING_CMD_START_NO << "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -109,8 +109,6 @@ int CmdStop::execute (std::string& output)
|
|||
<< "\n";
|
||||
rc = 1;
|
||||
}
|
||||
if (context.verbose ("blank"))
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -210,6 +210,7 @@ Command::Command ()
|
|||
, _needs_confirm (false)
|
||||
, _permission_quit (false)
|
||||
, _permission_all (false)
|
||||
, _first_iteration (true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -223,6 +224,7 @@ Command::Command (const Command& other)
|
|||
_needs_confirm = other._needs_confirm;
|
||||
_permission_quit = other._permission_quit;
|
||||
_permission_all = other._permission_all;
|
||||
_first_iteration = other._first_iteration;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -237,6 +239,7 @@ Command& Command::operator= (const Command& other)
|
|||
_needs_confirm = other._needs_confirm;
|
||||
_permission_quit = other._permission_quit;
|
||||
_permission_all = other._permission_all;
|
||||
_first_iteration = other._first_iteration;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -720,7 +723,10 @@ bool Command::permission (
|
|||
if (quantity < bulk && (!_needs_confirm || !confirmation))
|
||||
return true;
|
||||
|
||||
if (context.verbose ("blank") && !_first_iteration)
|
||||
std::cout << "\n";
|
||||
int answer = confirm4 (question);
|
||||
_first_iteration = false;
|
||||
switch (answer)
|
||||
{
|
||||
case 1: return true; // yes
|
||||
|
|
|
@ -80,6 +80,7 @@ protected:
|
|||
// Permission support
|
||||
bool _permission_quit;
|
||||
bool _permission_all;
|
||||
bool _first_iteration;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue