go-arg icon indicating copy to clipboard operation
go-arg copied to clipboard

Arguments that start with '-' not parsed correctly

Open reflog opened this issue 6 months ago • 1 comments

Hi! Here's a small issue I came across:

var args struct {
  Param string
}

./main --param A works ./main --param="-1h" works ./main --param "-1h" causes "error: missing value for -s"

Our CLI passes hour-differences this way and this used to work for us when using Go's flags, but unfortunately doesn't work with go-arg.

I understand that this is rather an edge case, but wanted to report it anyways.

Thanks for the great library!

reflog avatar Aug 14 '24 15:08 reflog