Documentation
¶
Index ¶
Constants ¶
const EmptyArgsUsage = " "
EmptyArgsUsage is used to specify that the command arguments section shouldn't be displayed in the help text. This is a workaround to avoid having to change the entire template.
Variables ¶
var AvailableOutputFormatStrings = []string{string(OutputFormatTable), string(OutputFormatJSON)}
AvailableOutputFormatStrings returns all the output formats available to users.
var FlagOutputFormat = &cli.StringFlag{ Name: "output", Aliases: []string{"o"}, Usage: fmt.Sprintf("Output `format`. Allowed values: %s", strings.Join(AvailableOutputFormatStrings, ", ")), Value: string(OutputFormatTable), }
FlagOutputFormat allows users to change the output format of commands that support it.
Functions ¶
func HumanizePolicyType ¶ added in v0.7.1
HumanizePolicyType converts the GraphQL PolicyType enum to a human readable string.
func HumanizeVCSProvider ¶ added in v0.7.1
HumanizeVCSProvider converts the GraphQL VCSProvider enum to a human readable string.
func OutputJSON ¶
func OutputJSON(v interface{}) error
OutputJSON outputs the specified object as JSON.
func OutputTable ¶
OutputTable outputs the specified data as a table.
Types ¶
type OutputFormat ¶
type OutputFormat string
OutputFormat defines the way that the results of a command are output to the user.
const ( // OutputFormatTable represents the output formatted in a table. OutputFormatTable OutputFormat = "table" // OutputFormatJSON represents the output formatted as JSON. OutputFormatJSON OutputFormat = "json" )
func GetOutputFormat ¶
func GetOutputFormat(cliContext *cli.Context) (OutputFormat, error)
GetOutputFormat gets the selected output format based on the CLI args.