igor: show - sort by owner #1160
Merged
Conversation
…name to make it easier to find your own reservations
src/igor/show.go
Outdated
@@ -151,7 +174,11 @@ func runShow(_ *Command, _ []string) { | |||
} | |||
// nameFmt will create uniform color bars for 1st column | |||
nameFmt := "%" + strconv.Itoa(maxResNameLength) + "v" | |||
sort.Sort(StartSorter(resarray)) | |||
if subO { | |||
sort.Sort(ByOwner(resarray)) |
…ructs we no longer need
Looks good. Do we want to sort each owner's reservations by start time? sort.Slice(resarray, func(i, j int) bool {
if resarray[i].Owner == resarray[j].Owner {
return resarray[i].StartTime < resarray[j].StartTime
}
return resarray[i].Owner < resarray[j].Owner
}) |
21a7944
into
sandia-minimega:master
1 check passed
1 check passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Adding an option to the show command to allow sorting by owner name to make it easier to find reservations by owner