diff options
| author | Michael Strùˆder <mikezter@gmail.com> | 2017-04-29 16:31:31 +0200 |
|---|---|---|
| committer | Grant Ammons <gammons@gmail.com> | 2017-05-09 20:20:24 -0400 |
| commit | ed6ab22cbdbc475adf539637e45a67811ec0c15a (patch) | |
| tree | 7ffd40d2b716ffa9d85bbbcbcf8242b4c8c4a847 /todolist/app.go | |
| parent | aa5050461a30d36a384edd45d20585a89d3da344 (diff) | |
display an error on malformed input
Diffstat (limited to 'todolist/app.go')
| -rw-r--r-- | todolist/app.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/todolist/app.go b/todolist/app.go index 24ebe4d..6d771ef 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -91,6 +91,18 @@ func (a *App) UnarchiveTodo(input string) { fmt.Println("Todo unarchived.") } +func (a *App) EditTodoSubject(input string) { + a.Load() + _, id, subject := Parser{input}.Parse() + id, todo := a.getId(input) + if id == -1 { + return + } + todo.Subject = subject + a.Save() + fmt.Println("Todo subject updated.") +} + func (a *App) EditTodoDue(input string) { a.Load() id, todo := a.getId(input) |
