MCPcopy
hub / github.com/cli/cli / toOrderByAndDirection

Function toOrderByAndDirection

pkg/cmd/discussion/list/list.go:165–187  ·  view source on GitHub ↗
(sort, order string)

Source from the content-addressed store, hash-verified

163}
164
165func toOrderByAndDirection(sort, order string) (string, string) {
166 var orderBy string
167 switch sort {
168 case sortCreated:
169 orderBy = client.OrderByCreated
170 case sortUpdated:
171 orderBy = client.OrderByUpdated
172 default:
173 orderBy = sort
174 }
175
176 var direction string
177 switch order {
178 case orderAsc:
179 direction = client.OrderDirectionAsc
180 case orderDesc:
181 direction = client.OrderDirectionDesc
182 default:
183 direction = order
184 }
185
186 return orderBy, direction
187}
188
189func listRun(opts *ListOptions) error {
190 repo, err := opts.BaseRepo()

Callers 1

listRunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected