Skip to content

Commit

Permalink
Guard against no arguments to edit command
Browse files Browse the repository at this point in the history
  • Loading branch information
igbanam committed May 21, 2023
1 parent 7784c59 commit 1565290
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func init() {
Long: longDesc,
Short: editCmdDesc,
Run: func(cmd *cobra.Command, args []string) {
if len(args) <= 0 {
fmt.Print("edit needs arguments. See ultralist e[dit] -h.\n")
return
}
todoID, err := strconv.Atoi(args[0])
if err != nil {
fmt.Printf("Could not parse todo ID: '%s'\n", args[0])
Expand Down

0 comments on commit 1565290

Please sign in to comment.