We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use kong to parse command line, but I found some problems while using it, one of them is "duplicate flag".
package main import "github.com/alecthomas/kong" var CLI struct { Rm struct { Force bool `help:"Force removal."` Recursive bool `help:"Recursively remove files."` Paths []string `arg:"" name:"path" help:"Paths to remove." type:"path"` Fast bool `name:"fast" negatable:"" help:"fast check"` } `cmd:"" help:"Remove files."` Ls struct { Paths []string `arg:"" optional:"" name:"path" help:"Paths to list." type:"path"` Fast bool `name:"fast" negatable:"" help:"fast check"` } `cmd:"" help:"List paths."` } func main() { ctx := kong.Parse(&CLI) switch ctx.Command() { case "rm <path>": case "ls": default: panic(ctx.Command()) } }
package main import "github.com/alecthomas/kong" var CLI struct { Config []string `help:"config value" short:"c"` Rm struct { Force bool `help:"Force removal."` Recursive bool `help:"Recursively remove files."` Paths []string `arg:"" name:"path" help:"Paths to remove." type:"path"` } `cmd:"" help:"Remove files."` Branch struct { Paths []string `arg:"" optional:"" name:"path" help:"Paths to list." type:"path"` Create bool `name:"create" short:"c" help:"Create branch"` } `cmd:"" help:"List paths."` } func main() { ctx := kong.Parse(&CLI) switch ctx.Command() { case "rm <path>": case "ls": default: panic(ctx.Command()) } }
In addition, it would be great if commands like git -c X=value switch -c new-branch could be supported. (First -c set config to command)
git -c X=value switch -c new-branch
-c
The text was updated successfully, but these errors were encountered:
26c1c9a
Thanks for the bug report!
Sorry, something went wrong.
No branches or pull requests
I use kong to parse command line, but I found some problems while using it, one of them is "duplicate flag".
In addition, it would be great if commands like
git -c X=value switch -c new-branch
could be supported. (First-c
set config to command)The text was updated successfully, but these errors were encountered: