Add help:json-fields annotation
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
This commit is contained in:
parent
1e88ec55fc
commit
506378cc21
1 changed files with 9 additions and 0 deletions
|
|
@ -83,6 +83,15 @@ func AddJSONFlags(cmd *cobra.Command, exportTarget *Exporter, fields []string) {
|
|||
}
|
||||
return e
|
||||
})
|
||||
|
||||
if len(fields) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if cmd.Annotations == nil {
|
||||
cmd.Annotations = map[string]string{}
|
||||
}
|
||||
cmd.Annotations["help:json-fields"] = strings.Join(fields, ",")
|
||||
}
|
||||
|
||||
func checkJSONFlags(cmd *cobra.Command) (*jsonExporter, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue