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

Function compareLess

cmd/format.go:67–80  ·  view source on GitHub ↗
(a, b files.IsMetadata, opts listOptions)

Source from the content-addressed store, hash-verified

65}
66
67func compareLess(a, b files.IsMetadata, opts listOptions) bool {
68 switch opts.sortBy {
69 case "name":
70 return strings.ToLower(entryPath(a)) < strings.ToLower(entryPath(b))
71 case "size":
72 return entrySize(a) < entrySize(b)
73 case "time":
74 return entryTime(a, opts).Before(entryTime(b, opts))
75 case "type":
76 return entryTypeOrder(a) < entryTypeOrder(b)
77 default:
78 return false
79 }
80}
81
82func entryPath(e files.IsMetadata) string {
83 switch f := e.(type) {

Callers 1

sortEntriesFunction · 0.85

Calls 4

entryPathFunction · 0.85
entrySizeFunction · 0.85
entryTimeFunction · 0.85
entryTypeOrderFunction · 0.85

Tested by

no test coverage detected