kordamp / gm

Gum is a Gradle/Maven/JBang wrapper written in Go
Apache License 2.0
59 stars 2 forks source link

Running program without arguments leads to panic #11

Closed littleli closed 4 years ago

littleli commented 4 years ago

I dislike the fact that commands panic when run without the arguments. It's unacceptable.

> gum.exe
panic: value method github.com/kordamp/gm/gum.MavenCommand.Execute called using nil *MavenCommand pointer

goroutine 1 [running]:
github.com/kordamp/gm/gum.(*MavenCommand).Execute(0x0)
        <autogenerated>:1 +0xb0
main.main()
        /home/runner/work/gm/gm/src/github.com/kordamp/gm/gm.go:56 +0x27f

Something like, use -gh for help or print help directly with different than 0 exit code is still better.

manikmagar commented 4 years ago

I am getting it even when I run gm verify on new installation if current directory is not a gradle/maven project -

image
aalmiray commented 4 years ago

This happens only when invoking gm outside of a project directory.