(Go: >> BACK << -|- >> HOME <<)

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

Incorrect behavior of the built-in help message for the help option #234

Open
vanyauhalin opened this issue Nov 27, 2023 · 1 comment
Open

Comments

@vanyauhalin
Copy link

Setup

$ cat go.mod
module main

go 1.21.4

require github.com/alexflint/go-arg v1.4.3

require github.com/alexflint/go-scalar v1.1.0 // indirect
$ cat main.go
package main

import (
	arg "github.com/alexflint/go-arg"
)

type options struct {
	Sub *Sub `arg:"subcommand"`
}

type Sub struct {
	A string `arg:"positional"`
}

func main() {
	var opts options
	arg.MustParse(&opts)
}

Actual

$ go run . sub --help
Usage: main sub [A]

Positional arguments:
  A
  --help, -h             display this help and exit

Expected

$ go run . sub --help
Usage: main sub [A]

Positional arguments:
  A

Global options:
  --help, -h             display this help and exit
@alexflint
Copy link
Owner

Yeah I think you're right. Will look at changing this. Thanks for reporting!

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