mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
C++11: N2672 Initializer lists
- Modified code to use the more compact and readable initializer lists.
This commit is contained in:
parent
49f7612704
commit
7bbc794d3a
25 changed files with 136 additions and 231 deletions
18
src/util.cpp
18
src/util.cpp
|
@ -65,9 +65,8 @@ extern Context context;
|
|||
// std::getline, the newline can be detected, and the prompt re-written.
|
||||
bool confirm (const std::string& question)
|
||||
{
|
||||
std::vector <std::string> options;
|
||||
options.push_back (STRING_UTIL_CONFIRM_YES);
|
||||
options.push_back (STRING_UTIL_CONFIRM_NO);
|
||||
std::vector <std::string> options {STRING_UTIL_CONFIRM_YES,
|
||||
STRING_UTIL_CONFIRM_NO};
|
||||
|
||||
std::string answer;
|
||||
std::vector <std::string> matches;
|
||||
|
@ -94,13 +93,12 @@ bool confirm (const std::string& question)
|
|||
// 3 = quit
|
||||
int confirm4 (const std::string& question)
|
||||
{
|
||||
std::vector <std::string> options;
|
||||
options.push_back (STRING_UTIL_CONFIRM_YES_U);
|
||||
options.push_back (STRING_UTIL_CONFIRM_YES);
|
||||
options.push_back (STRING_UTIL_CONFIRM_NO);
|
||||
options.push_back (STRING_UTIL_CONFIRM_ALL_U);
|
||||
options.push_back (STRING_UTIL_CONFIRM_ALL);
|
||||
options.push_back (STRING_UTIL_CONFIRM_QUIT);
|
||||
std::vector <std::string> options {STRING_UTIL_CONFIRM_YES_U,
|
||||
STRING_UTIL_CONFIRM_YES,
|
||||
STRING_UTIL_CONFIRM_NO,
|
||||
STRING_UTIL_CONFIRM_ALL_U,
|
||||
STRING_UTIL_CONFIRM_ALL,
|
||||
STRING_UTIL_CONFIRM_QUIT};
|
||||
|
||||
std::string answer;
|
||||
std::vector <std::string> matches;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue