fix delete/done

This commit is contained in:
Erik Winter 2024-12-31 08:47:39 +01:00
parent 8dc93f227e
commit bcce505934
3 changed files with 6 additions and 2 deletions

BIN
dist/plan vendored

Binary file not shown.

View File

@ -14,7 +14,7 @@ func NewDeleteArgs() DeleteArgs {
}
func (da DeleteArgs) Parse(main []string, flags map[string]string) (Command, error) {
if len(main) < 2 || main[0] != "delete" {
if len(main) < 2 || (main[0] != "delete" && main[0] != "done") {
return nil, ErrWrongCommand
}
@ -71,7 +71,7 @@ func (del *Delete) Do(deps Dependencies) (CommandResult, error) {
return nil, fmt.Errorf("could not delete task: %v", err)
}
return nil, nil
return DeleteResult{}, nil
}
type DeleteResult struct{}

View File

@ -42,6 +42,10 @@ func TestDelete(t *testing.T) {
name: "valid",
main: []string{"delete", "1"},
},
{
name: "done",
main: []string{"done", "1"},
},
} {
t.Run(tc.name, func(t *testing.T) {
// setup