-
Notifications
You must be signed in to change notification settings - Fork 7
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
add support for json/yaml output to list #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Just a small question about the flag!
cmd/promlinter/main.go
Outdated
@@ -58,6 +60,7 @@ func main() { | |||
Default("false").Short('s').Bool() | |||
listPrintAddPos := listCmd.Flag("add-position", "Add metric position column when printing the result.").Default("false").Bool() | |||
listPrintAddHelp := listCmd.Flag("add-help", "Add metric help column when printing the result.").Default("false").Bool() | |||
listPrintJSON := listCmd.Flag("json", "Print result as json.").Default("false").Bool() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a bool for printing out using json format, what do you think about having an output
flag as a string to be extensible to support different formats like json, markdown, etc
Sounds like a good idea. Let me check if i can add support for the other usual suspect (yaml). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR adds support to print the output of list in json format.
The format is quite handy it you want to process further e.g. during generation of documentation.
use
-oyaml
/--ojson
--output= ...