diff --git a/ChangeLog b/ChangeLog index 90c093c29..b5f7314d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -81,6 +81,8 @@ - TW-1638 Undo doesn't work when a context is set (thanks to Jeremy John Reeder). - TW-1640 '_get .start' for an inactive tasks returns a date formatted from epoch 0. +- TW-1641 'edit' should process or reject arguments (thanks to Daniel + Shahaf). - Prevent potential task duplication during import for non-pending tasks. - Show the active context in "context list", if any is active. - Fix "task edit" dropping annotation text after newlines. diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 12a705a28..00d838dfa 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -67,6 +67,9 @@ int CmdEdit::execute (std::string& output) std::vector filtered; filter.subset (filtered); + if (filter.hasModifications ()) + throw std::string (STRING_ERROR_NO_MODS); + // Find number of matching tasks. for (auto& task : filtered) { diff --git a/src/l10n/deu-DEU.h b/src/l10n/deu-DEU.h index 8b33c84f5..7703101b0 100644 --- a/src/l10n/deu-DEU.h +++ b/src/l10n/deu-DEU.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "Nach Spalte '{1}' kann nicht sortiert weden." #define STRING_TLS_INIT_FAIL "Fehler bei der TLS-Initialisierung. {1}" #define STRING_ERROR_DETAILS "Die Option 'calendar.details.report' muss einen einzelnen Report-Namen enthalten." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "Keine Aufgaben." diff --git a/src/l10n/eng-USA.h b/src/l10n/eng-USA.h index b08da5afa..4e8647e15 100644 --- a/src/l10n/eng-USA.h +++ b/src/l10n/eng-USA.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." #define STRING_TLS_INIT_FAIL "Error initializing TLS. {1}" #define STRING_ERROR_DETAILS "The setting 'calendar.details.report' must contain a single report name." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "No tasks." diff --git a/src/l10n/epo-RUS.h b/src/l10n/epo-RUS.h index 8c56fd683..503c1c42c 100644 --- a/src/l10n/epo-RUS.h +++ b/src/l10n/epo-RUS.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "Kolumno '{1}' ne estas valida kampo por ordigi." #define STRING_TLS_INIT_FAIL "Erara eko de TLS. {1}" #define STRING_ERROR_DETAILS "Agordo 'calendar.details.report' devas enhavi sole unu raportnomon." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "Nenia tasko." diff --git a/src/l10n/esp-ESP.h b/src/l10n/esp-ESP.h index 01607cce2..741da1508 100644 --- a/src/l10n/esp-ESP.h +++ b/src/l10n/esp-ESP.h @@ -759,6 +759,7 @@ #define STRING_INVALID_SORT_COL "La columna '{1}' no es un campo de ordenación válido." #define STRING_TLS_INIT_FAIL "Error inicializando TLS. {1}" #define STRING_ERROR_DETAILS "El ajuste 'calendar.details.report' debe contener un único nombre de informe." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "Ninguna tarea." diff --git a/src/l10n/fra-FRA.h b/src/l10n/fra-FRA.h index 9aff5a244..09478cbe1 100644 --- a/src/l10n/fra-FRA.h +++ b/src/l10n/fra-FRA.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." #define STRING_TLS_INIT_FAIL "Erreur en initialisant TLS. {1}" #define STRING_ERROR_DETAILS "The setting 'calendar.details.report' must contain a single report name." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "No tasks." diff --git a/src/l10n/ita-ITA.h b/src/l10n/ita-ITA.h index 5ae85a7bc..0154456d8 100644 --- a/src/l10n/ita-ITA.h +++ b/src/l10n/ita-ITA.h @@ -746,6 +746,7 @@ #define STRING_INVALID_SORT_COL "La colonna '{1}' non è un campo di ordinamento valido." #define STRING_TLS_INIT_FAIL "Error initializing TLS. {1}" #define STRING_ERROR_DETAILS "The setting 'calendar.details.report' must contain a single report name." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "Nessun task." diff --git a/src/l10n/jpn-JPN.h b/src/l10n/jpn-JPN.h index c37dc6cda..f39fabc90 100644 --- a/src/l10n/jpn-JPN.h +++ b/src/l10n/jpn-JPN.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." #define STRING_TLS_INIT_FAIL "TLS初期化でエラー。 {1}" #define STRING_ERROR_DETAILS "The setting 'calendar.details.report' must contain a single report name." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "タスクがない。" diff --git a/src/l10n/pol-POL.h b/src/l10n/pol-POL.h index 2c1cc4a89..d14996444 100644 --- a/src/l10n/pol-POL.h +++ b/src/l10n/pol-POL.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "Kolumna '{1}' nie jest poprawnym parametrem sortowania." #define STRING_TLS_INIT_FAIL "Błąd inicjalizacji TLS." #define STRING_ERROR_DETAILS "Zmienna 'calendar.details.report' musi zawierać nazwę raportu." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "Brak zadań." diff --git a/src/l10n/por-PRT.h b/src/l10n/por-PRT.h index e03f1add1..7532f3746 100644 --- a/src/l10n/por-PRT.h +++ b/src/l10n/por-PRT.h @@ -747,6 +747,7 @@ #define STRING_INVALID_SORT_COL "A coluna '{1}' não pode ser ordenada." #define STRING_TLS_INIT_FAIL "Erro a iniciar componente TLS. {1}" #define STRING_ERROR_DETAILS "A definição 'calendar.details.report' pode apenas indicar um nome de relatório." +#define STRING_ERROR_NO_MODS "Command line modifications are not support by this command." // Feedback #define STRING_FEEDBACK_NO_TASKS "Nenhuma tarefa." diff --git a/test/edit.t b/test/edit.t index bd61bf235..04ab8a9b7 100755 --- a/test/edit.t +++ b/test/edit.t @@ -83,6 +83,11 @@ class TestTaskEdit(TestCase): # Does not fail self.t("1 edit") + def test_command_line_modifications(self): + """Verify that the 'edit' command does not accept command line modifications""" + code, out, err = self.t.runError("1 edit +foo") + self.assertIn("Command line modifications are not support by this command.", err) + if __name__ == "__main__": from simpletap import TAPTestRunner