This commit is contained in:
Erik Winter 2024-12-29 14:13:42 +01:00
parent 2e67160fc7
commit e5d6cd7141
2 changed files with 10 additions and 5 deletions

BIN
dist/plan vendored

Binary file not shown.

View File

@ -18,7 +18,7 @@ func NewListArgs() ListArgs {
} }
func (la ListArgs) Parse(main []string, flags map[string]string) (Command, error) { func (la ListArgs) Parse(main []string, flags map[string]string) (Command, error) {
if len(main) > 1 { if len(main) > 2 {
return nil, ErrWrongCommand return nil, ErrWrongCommand
} }
@ -40,12 +40,17 @@ func (la ListArgs) Parse(main []string, flags map[string]string) (Command, error
case slices.Contains([]string{"tomorrow", "tom"}, main[0]): case slices.Contains([]string{"tomorrow", "tom"}, main[0]):
date = tomorrow date = tomorrow
case main[0] == "list": case main[0] == "list":
} default:
case 2:
if main[0] != "list" || main[1] != "recur" {
return nil, ErrWrongCommand return nil, ErrWrongCommand
} }
case 2:
if main[0] == "list" && main[1] == "recur" {
recurrer = true recurrer = true
} else {
return nil, ErrWrongCommand
}
default:
return nil, ErrWrongCommand
} }
return &List{ return &List{