cli: sort local racks first (#90)

This commit is contained in:
David Dollar 2020-01-29 19:15:46 -05:00 committed by GitHub
parent 9db77c1156
commit 2985a8d66c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -296,9 +296,12 @@ func racks(c *stdcli.Context) ([]rack, error) {
rs = append(rs, rrs...)
sort.Slice(rs, func(i, j int) bool {
if !rs[i].Remote && rs[j].Remote {
switch {
case !rs[i].Remote && rs[j].Remote:
return true
} else {
case rs[i].Remote && !rs[j].Remote:
return false
default:
return rs[i].Name < rs[j].Name
}
})