diff --git a/dist/plan b/dist/plan index 87b25ec..0f7ec04 100755 Binary files a/dist/plan and b/dist/plan differ diff --git a/plan/command/list.go b/plan/command/list.go index a616223..2d83299 100644 --- a/plan/command/list.go +++ b/plan/command/list.go @@ -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{