defaults
This commit is contained in:
parent
2e67160fc7
commit
e5d6cd7141
|
@ -18,7 +18,7 @@ func NewListArgs() ListArgs {
|
|||
}
|
||||
|
||||
func (la ListArgs) Parse(main []string, flags map[string]string) (Command, error) {
|
||||
if len(main) > 1 {
|
||||
if len(main) > 2 {
|
||||
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]):
|
||||
date = tomorrow
|
||||
case main[0] == "list":
|
||||
}
|
||||
case 2:
|
||||
if main[0] != "list" || main[1] != "recur" {
|
||||
default:
|
||||
return nil, ErrWrongCommand
|
||||
}
|
||||
recurrer = true
|
||||
case 2:
|
||||
if main[0] == "list" && main[1] == "recur" {
|
||||
recurrer = true
|
||||
} else {
|
||||
return nil, ErrWrongCommand
|
||||
}
|
||||
default:
|
||||
return nil, ErrWrongCommand
|
||||
}
|
||||
|
||||
return &List{
|
||||
|
|
Loading…
Reference in New Issue