-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Flags in commands #54
Comments
Oops. It was the flag library that was doing it. Not cli's fault. |
Oh. I've been up for too long. It is an issue. Flags aren't working properly with commands: package main
import (
"os"
"github.com/codegangsta/cli"
)
func main() {
app := cli.NewApp()
app.Name = "app"
app.Commands = []cli.Command{
{
Name: "command",
Action: func(c *cli.Context) {
println("command")
},
Flags: []cli.Flag{
cli.BoolFlag{"flag,f", "just a flag"},
},
},
}
app.Run(os.Args)
} Running this produces: $ ./app command --flag
flag provided but not defined: -flag
Usage of command:
-flag,f=false: just a flag
command |
hm. this does seem like a bug. I will look into it soon |
@marksteve I am not able to reproduce this on latest master of cli. By the look of that output it looks like you are running an older version that doesn't support the "flag,f" support |
Did a go get -u and yeah it works now. Sorry about that. I was sure that it was my first time go get-ting the library but apparently I did before. Thanks for checking it out 😄 |
No problem! On Wed, Dec 11, 2013 at 6:36 PM, Mark Steve Samson <notifications@github.com
|
I expected appending
--help
with only show usage but:The text was updated successfully, but these errors were encountered: