Comments (6)
Oops. It was the flag library that was doing it. Not cli's fault.
from cli.
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
from cli.
hm. this does seem like a bug. I will look into it soon
from cli.
@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
from cli.
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 😄
from cli.
No problem!
On Wed, Dec 11, 2013 at 6:36 PM, Mark Steve Samson <[email protected]
wrote:
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 [image: 😄]—
Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-30384846
.
from cli.
Related Issues (20)
- How do I define Usage for BoolWithInverseFlag? HOT 23
- Shell completions are broken when login shell is different than currently active shell
- Use mkdocs `mike` for multi-version docs
- Strictly limit default dependencies to stdlib HOT 6
- Build out all of the v3 documentation
- Vendor usage of `github.com/xrash/smetrics` for suggestions HOT 2
- Delete stale branches HOT 5
- Use gofumpt
- Man page generation feature is not documented anywhere HOT 3
- Doc generation default value set by environment variable HOT 4
- Expose shell completions scripts in by default in the `completion` command HOT 5
- More powerful shell completion HOT 2
- Ensure `go mod tidy` works as expected HOT 1
- Target `stable` and `oldstable` in main CI
- Flags are alphabetically sorted when using categories HOT 3
- Should I expect completion of nested command's flags to work? HOT 31
- AfterFunc execution details HOT 7
- Remove [command [command options]] from help text if there are no sub commands HOT 3
- Default `cli.App.Usage` behaviour is very hard to override and leads to ugly help HOT 1
- Allow omission of default text in help text HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.