fix delete/done
This commit is contained in:
parent
8dc93f227e
commit
bcce505934
|
@ -14,7 +14,7 @@ func NewDeleteArgs() DeleteArgs {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (da DeleteArgs) Parse(main []string, flags map[string]string) (Command, error) {
|
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
|
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, fmt.Errorf("could not delete task: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, nil
|
return DeleteResult{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteResult struct{}
|
type DeleteResult struct{}
|
||||||
|
|
|
@ -42,6 +42,10 @@ func TestDelete(t *testing.T) {
|
||||||
name: "valid",
|
name: "valid",
|
||||||
main: []string{"delete", "1"},
|
main: []string{"delete", "1"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "done",
|
||||||
|
main: []string{"done", "1"},
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
// setup
|
// setup
|
||||||
|
|
Loading…
Reference in New Issue