Add common --format flag support#3454
Conversation
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
| case coreformat.Json: | ||
| return printConfigShowJSON(configs) |
There was a problem hiding this comment.
do we have a way to make this a common function so sub command creator dont worry about it ?
| return nil | ||
| // getTokenOutputFormat returns the requested output format, defaulting to json | ||
| // to preserve backward-compatible behaviour (the command always emitted JSON). | ||
| func getTokenOutputFormat(c *cli.Context) (coreformat.OutputFormat, error) { |
There was a problem hiding this comment.
make it common in cli context ?
There was a problem hiding this comment.
cli.Context is in urfave/cli. But it is doable in plugins that use our own encapsulation of context.
5e1d2fa to
7bf5ae2
Compare
7bf5ae2 to
3b95d48
Compare
3b95d48 to
fdbab1d
Compare
fdbab1d to
9b2e6bd
Compare
9b2e6bd to
af54846
Compare
af54846 to
83d204e
Compare
83d204e to
25b9864
Compare
25b9864 to
fe21cb8
Compare
fe21cb8 to
5af9d26
Compare
masterbranch.go vet ./....go fmt ./....