(config config.Config, context *CommandExecContext)
| 132 | } |
| 133 | |
| 134 | func (b CommandBuilder) outputFormat(config config.Config, context *CommandExecContext) (string, error) { |
| 135 | outputFormat := context.String(FlagNameOutputFormat) |
| 136 | if outputFormat == "" { |
| 137 | outputFormat = config.Output |
| 138 | } |
| 139 | if outputFormat == "" { |
| 140 | outputFormat = FlagValueOutputFormatJson |
| 141 | } |
| 142 | if outputFormat != FlagValueOutputFormatJson && outputFormat != FlagValueOutputFormatText { |
| 143 | return "", fmt.Errorf("Invalid output format '%s', allowed values: %s, %s", outputFormat, FlagValueOutputFormatJson, FlagValueOutputFormatText) |
| 144 | } |
| 145 | return outputFormat, nil |
| 146 | } |
| 147 | |
| 148 | func (b CommandBuilder) createBaseUri(operation parser.Operation, config config.Config, context *CommandExecContext) (url.URL, error) { |
| 149 | uriArgument, err := b.parseUriArgument(context) |
no test coverage detected