This isolates the listing of the different formats to the output.go
file. It is more future-proof if another format is added.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
cmd.Flags().VarP(newOutputValue(output.Table,varRef),outputFlag,"o",fmt.Sprintf("prints the output in the specified format. Allowed values: %s, %s, %s",output.Table,output.JSON,output.YAML))
varformatsstrings.Builder
forindex,format:=rangeoutput.Formats(){
ifindex!=0{
formats.WriteString(", ")
}
formats.WriteString(format.String())
}
cmd.Flags().VarP(newOutputValue(output.Table,varRef),outputFlag,"o",fmt.Sprintf("prints the output in the specified format. Allowed values: %s",formats.String()))