MCPcopy Create free account
hub / github.com/dropbox/dbxcli / validateListOptions

Function validateListOptions

cmd/list_options.go:44–55  ·  view source on GitHub ↗
(opts listOptions)

Source from the content-addressed store, hash-verified

42}
43
44func 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
57func validListSort(sortBy string) bool {
58 switch sortBy {

Callers 1

parseListOptionsFunction · 0.85

Calls 5

validListSortFunction · 0.85
flagValueErrorDetailsFunction · 0.85
validListTimeFieldFunction · 0.85
validListTimeFormatFunction · 0.85

Tested by

no test coverage detected