diff --git a/ChangeLog b/ChangeLog index bfe45a440..44d5fb9b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,6 +59,8 @@ Steve Rader). + Fixed bug #589, where the man page did not adequately describe searching or usage of attribute modifiers (thanks to Steve Rader). + + Applied patch to fix bug #590, which makes the yes/no/all/quit confirmation + prompts consistent (thanks to Steve Rader). + Fixed bug #595, where taskwarrior ignored changes to the wait date during the edit command, consequently not changing task status (thanks to Eric Fluger). diff --git a/src/util.cpp b/src/util.cpp index a56f9b314..aceb46472 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -83,8 +83,10 @@ int confirm3 (const std::string& question) { std::vector options; options.push_back ("Yes"); + options.push_back ("yes"); options.push_back ("no"); options.push_back ("All"); + options.push_back ("all"); std::string answer; std::vector matches; @@ -93,9 +95,9 @@ int confirm3 (const std::string& question) { std::cout << question << " (" - << options[0] << "/" << options[1] << "/" - << options[2] + << options[2] << "/" + << options[4] << ") "; std::getline (std::cin, answer); @@ -105,7 +107,9 @@ int confirm3 (const std::string& question) while (matches.size () != 1); if (matches[0] == "Yes") return 1; + else if (matches[0] == "yes") return 1; else if (matches[0] == "All") return 2; + else if (matches[0] == "all") return 2; else return 0; } @@ -118,8 +122,10 @@ int confirm4 (const std::string& question) { std::vector options; options.push_back ("Yes"); + options.push_back ("yes"); options.push_back ("no"); options.push_back ("All"); + options.push_back ("all"); options.push_back ("quit"); std::string answer; @@ -129,10 +135,10 @@ int confirm4 (const std::string& question) { std::cout << question << " (" - << options[0] << "/" << options[1] << "/" << options[2] << "/" - << options[3] + << options[4] << "/" + << options[5] << ") "; std::getline (std::cin, answer); @@ -142,7 +148,9 @@ int confirm4 (const std::string& question) while (matches.size () != 1); if (matches[0] == "Yes") return 1; + else if (matches[0] == "yes") return 1; else if (matches[0] == "All") return 2; + else if (matches[0] == "all") return 2; else if (matches[0] == "quit") return 3; else return 0; } diff --git a/test/confirmation.t b/test/confirmation.t index 2760d7769..292adca69 100755 --- a/test/confirmation.t +++ b/test/confirmation.t @@ -93,7 +93,7 @@ like ($output, qr/Task not deleted\./, 'confirmation - N works'); # Test Yes for multiple changes $output = qx{echo -e "y\nY\nY\nY\nY" | ../src/task rc:confirm.rc 7-10 +bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - Y works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - Y works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - Y works'); like ($output, qr/Task 8 "foo"/, 'multiple confirmations - Y works'); like ($output, qr/Task 9 "foo"/, 'multiple confirmations - Y works'); @@ -102,7 +102,7 @@ like ($output, qr/Modified 4 tasks/, 'multiple confirmations - Y works'); # Test no for multiple changes $output = qx{echo -e "N\nn\nn\nn\nn" | ../src/task rc:confirm.rc 7-10 -bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - n works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - n works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - n works'); like ($output, qr/Task 8 "foo"/, 'multiple confirmations - n works'); like ($output, qr/Task 9 "foo"/, 'multiple confirmations - n works'); @@ -111,14 +111,14 @@ like ($output, qr/Modified 0 tasks/, 'multiple confirmations - n works'); # Test All for multiple changes $output = qx{echo -e "a\nA" | ../src/task rc:confirm.rc 7-10 -bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - A works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - A works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - A works'); unlike ($output, qr/Task 8 "foo"/, 'multiple confirmations - A works'); like ($output, qr/Modified 4 tasks/, 'multiple confirmations - A works'); # Test quit for multiple changes $output = qx{echo "q" | ../src/task rc:confirm.rc 7-10 +bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - q works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - q works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - q works'); unlike ($output, qr/Task 8 "foo"/, 'multiple confirmations - q works'); like ($output, qr/Modified 0 tasks/, 'multiple confirmations - q works');