Skip to content

Commit c3f7596

Browse files
committed
sort the output of "show users" and "show groups"
1 parent 8cb6d90 commit c3f7596

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ http://www.cecill.info for details.
7878
Authors
7979
-------
8080

81-
Arnaud Guignard <[email protected]>
82-
Cyril Servant <[email protected]>
81+
Arnaud Guignard <[email protected]>, Cyril Servant <[email protected]>
8382

8483
Documentation
8584
-------------

cmd/sshproxyctl/sshproxyctl.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ func showUsers(configFile string, csvFlag bool, jsonFlag bool, allFlag bool) {
282282
i++
283283
}
284284

285+
sort.Slice(rows, func(i,j int) bool {
286+
return rows[i][0] < rows[j][0]
287+
})
288+
285289
if csvFlag {
286290
displayCSV(rows)
287291
} else {
@@ -316,6 +320,10 @@ func showGroups(configFile string, csvFlag bool, jsonFlag bool, allFlag bool) {
316320
i++
317321
}
318322

323+
sort.Slice(rows, func(i,j int) bool {
324+
return rows[i][0] < rows[j][0]
325+
})
326+
319327
if csvFlag {
320328
displayCSV(rows)
321329
} else {

0 commit comments

Comments
 (0)