replit / upm

⠕ Universal Package Manager - Python, Node.js, Ruby, Emacs Lisp.
https://repl.it
Other
1.06k stars 91 forks source link

Avoid panicking on CLI error #203

Closed blast-hardcheese closed 10 months ago

blast-hardcheese commented 10 months ago

This isn't great:

$ upm init
Error: unknown command "init" for "upm"

Did you mean this?
        info

Run 'upm --help' for usage.
panic: unknown command "init" for "upm"

Did you mean this?
        info

goroutine 1 [running]:
github.com/replit/upm/internal/cli.DoCLI()
        .../upm/internal/cli/cli.go:344 +0x1888
main.main()
        .../upm/cmd/upm/main.go:10 +0x1c

Since cobra already does its own error logging, we can probably just exit 1 and call it a day.