Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

igor: show - sort by owner #1160

Merged
merged 3 commits into from Aug 27, 2018
Merged

igor: show - sort by owner #1160

merged 3 commits into from Aug 27, 2018

Conversation

@csymonds
Copy link
Contributor

@csymonds csymonds commented Aug 13, 2018

Adding an option to the show command to allow sorting by owner name to make it easier to find reservations by owner

…name to make it easier to find your own reservations
@csymonds csymonds requested a review from jcrussell Aug 13, 2018
@@ -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))

This comment has been minimized.

…ructs we no longer need
@jcrussell
Copy link
Contributor

@jcrussell jcrussell commented Aug 22, 2018

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
		})
@csymonds csymonds merged commit 21a7944 into sandia-minimega:master Aug 27, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.