(opts listOptions)
| 42 | } |
| 43 | |
| 44 | func validateListOptions(opts listOptions) error { |
| 45 | if !validListSort(opts.sortBy) { |
| 46 | return invalidArgumentsErrorfWithDetails("invalid --sort %q (use name, size, time, or type)", flagValueErrorDetails("sort", opts.sortBy), opts.sortBy) |
| 47 | } |
| 48 | if !validListTimeField(opts.timeField) { |
| 49 | return invalidArgumentsErrorfWithDetails("invalid --time %q (use server or client)", flagValueErrorDetails("time", opts.timeField), opts.timeField) |
| 50 | } |
| 51 | if !validListTimeFormat(opts.timeFormat) { |
| 52 | return invalidArgumentsErrorfWithDetails("invalid --time-format %q (use short or rfc3339)", flagValueErrorDetails("time-format", opts.timeFormat), opts.timeFormat) |
| 53 | } |
| 54 | return nil |
| 55 | } |
| 56 | |
| 57 | func validListSort(sortBy string) bool { |
| 58 | switch sortBy { |
no test coverage detected