Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse negative positional argument #478

Open
apatniv opened this issue Dec 15, 2024 · 2 comments
Open

Unable to parse negative positional argument #478

apatniv opened this issue Dec 15, 2024 · 2 comments

Comments

@apatniv
Copy link

apatniv commented Dec 15, 2024

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
@dbohdan
Copy link

dbohdan commented Dec 15, 2024

This looks like a duplicate of the same problem as #315. Namely, Kong doesn't override short flag parsing where it can expect a negative-number argument.

@apatniv
Copy link
Author

apatniv commented Dec 15, 2024

I can try to work on this to fix this if no one is already working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants