| 163 | } |
| 164 | |
| 165 | func 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 | |
| 189 | func listRun(opts *ListOptions) error { |
| 190 | repo, err := opts.BaseRepo() |