From aa41a6e37a686448142809bb3a80a2ee9040e5cc Mon Sep 17 00:00:00 2001 From: Andy Hunt Date: Thu, 18 Aug 2022 14:24:02 +0100 Subject: [PATCH] Show the help text when zero arguments given to the edit command Previously, ultralist would panic when given zero arguments. It should should show the help text instead. --- cmd/edit.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/edit.go b/cmd/edit.go index bccd3413..1b7f29aa 100644 --- a/cmd/edit.go +++ b/cmd/edit.go @@ -41,6 +41,11 @@ func init() { Long: longDesc, Short: editCmdDesc, Run: func(cmd *cobra.Command, args []string) { + if len(args) == 0 { + _ = cmd.Help() + return + } + todoID, err := strconv.Atoi(args[0]) if err != nil { fmt.Printf("Could not parse todo ID: '%s'\n", args[0])