-
-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
Currently, when subcommands are defined alongside normal arguments, the arguments for parent commands aren't listed in the usage text for the subcommand.
Example:
package main
import (
"fmt"
"github.com/alexflint/go-arg"
)
type BarCmd struct {
Baz string
}
type Args struct {
Foo string
Bar *BarCmd `arg:"subcommand:bar"`
}
func main() {
var args Args
if err := arg.MustParse(&args); err != nil {
fmt.Println(err)
return
}
}When this is called as ./args bar --help, the usage text looks like:
Usage: args bar [--baz BAZ]
However, in several cases, one would want it to look like:
Usage: args [--foo FOO] bar [--baz BAZ]
Is this the intended behavior? If not, I'd be happy to open a PR.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels