Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/cca/cca.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func NewCommand() *cobra.Command {

cmd.PersistentFlags().StringVar(&flags.APIURL, "api-url", cmdutil.DefaultAPIURL, "API url cloud.ca resources")
cmd.PersistentFlags().StringVar(&flags.APIKey, "api-key", "", "API Key to access cloud.ca resources")
cmd.PersistentFlags().StringVar(&flags.OutputFormat, "output", cmdutil.DefaultOutputFormat, "output format "+output.FormatString())
cmd.PersistentFlags().BoolVar(new(bool), "nocolor", false, "Disable colored output")
cmd.PersistentFlags().StringVar(&flags.OutputFormat, "output-format", cmdutil.DefaultOutputFormat, "output format "+output.FormatStrings())
cmd.PersistentFlags().BoolVar(&flags.OutputColored, "output-colored", false, "Enable or disable colored output")
cmd.PersistentFlags().StringVar(&flags.LogLevel, "loglevel", cmdutil.DefaultLogLevel.String(), "log level "+logutil.LevelsString())

cmd.AddCommand(completion.NewCommand(flags))
Expand Down
1 change: 1 addition & 0 deletions pkg/cmdutil/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type GlobalFlags struct {
ColorOutput bool
EnvironmentID string
LogLevel string
OutputColored bool
OutputFormat string
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/output/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func Has(format string) bool {
return false
}

// FormatString returns a string representing all output formats
// FormatStrings returns a string representing all output formats.
// this is useful for help text / flag info
func FormatString() string {
func FormatStrings() string {
var b strings.Builder
b.WriteString("[")
for i, format := range outputFormats {
Expand Down