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

Unknown arguments supplied #84

Open
yougg opened this issue Aug 21, 2022 · 0 comments · May be fixed by #87
Open

Unknown arguments supplied #84

yougg opened this issue Aug 21, 2022 · 0 comments · May be fixed by #87

Comments

@yougg
Copy link

yougg commented Aug 21, 2022

"Unknown arguments supplied" when the subcommand and flag have same shortname

// example.go
package main

import (
	"fmt"

	"github.com/integrii/flaggy"
)

func main() {
	subcmd := flaggy.NewSubcommand("testSubCmd")
	subcmd.ShortName = `t`
	var test string
	subcmd.String(&test, "t", "testFlag", "test flag")
	flaggy.AttachSubcommand(subcmd, 1)
	flaggy.Parse()
	fmt.Println(test)
}

go run example.go t -t hello
testSubCmd

Flags:
--version Displays the program version string.
-h --help Displays help with available flag, subcommand, and positional value parameters.
-t --testFlag test flag

Unknown arguments supplied: hello
exit status 2

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

Successfully merging a pull request may close this issue.

1 participant