Comments (2)
Thirumarant, do you have some sample code that replicates this, or does it always occur regardless of the input?
from cli.
My code
ui := &cli.BasicUi{Writer: os.Stdout}
meta := command.Meta {
Ui: ui,
}
Commands = map[string]cli.CommandFactory{
"apply": func() (cli.Command, error) {
return &command.ApplyCommand {
Ui: ui,
}, nil
},
"create": func() (cli.Command, error) {
return &command.CreateCommand {
Meta: meta,
Ui: ui,
}, nil
},
..
..
m.Password, err = m.Ui.AskSecret("Please provide a password: ")
answer, err := cc.Ui.Ask("Use default template? [y/n]")
I worked out that I wasn't passing in a reader. Correcting the code to this worked as expected
ui := &cli.BasicUi{Writer: os.Stdout, Reader: os.Stdin}
The thing that threw me off was, using AskSecret worked without passing the reader but as soon as I started using Ask the panic started
from cli.
Related Issues (20)
- Root command
- Replace current completion generation package with something else HOT 1
- Sporadic test failures in "TestCLIRun_printCommandHelpSubcommands" HOT 5
- please tag and version this project HOT 9
- Top level help shows all subcommand children HOT 2
- Compatibility with standard library `flag` package HOT 3
- Generate help text from command options HOT 2
- Nested Subcommand Help HOT 3
- Flag named version causes application version to be printed incorrectly HOT 1
- Mark commands (and flags) as hidden HOT 5
- panic if a subcommand is wrapped in double quotes and contains spaces HOT 2
- is there support for interactive mode? HOT 3
- default subcommand throws stack overflow HOT 2
- 1.0.0: FAIL: TestCLIAutocomplete_subcommandArgs/RE HOT 1
- Versus cobra cli HOT 1
- How to write shell completion function in Go
- Subcommand parsing logic stops at first flag HOT 3
- Subcommand parsing: "fooasdf -o=foo" is incorrectly identified as the subcommand "foo"
- Update github.com/Masterminds/sprig HOT 1
- Add flags dynamically HOT 1
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.