+
Skip to content

Unable to parse negative positional argument #478

Closed
@apatniv

Description

@apatniv

Version: v1.6.0

func main() {
	var cli struct {
		Id int `arg:"" help:"Provide an id"`
	}
	_ = kong.Parse(&cli)
	fmt.Printf("cli:%+v\n", cli)
}

Unable to parse negative number like: -100

$ go run main.go -100
main: error: unknown flag -1, did you mean "-h"?
exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载