Skip to content
Snippets Groups Projects
Commit 03c2d888 authored by Florent Gluck's avatar Florent Gluck
Browse files

client: usersetcaps, vmaddaccess now display capabilities in alphabetical...

client: usersetcaps, vmaddaccess now display capabilities in alphabetical order; fixed missing carriage return in usersetcaps
Bumpped client to version 1.11.1
parent 1aedd3b3
No related branches found
No related tags found
No related merge requests found
......@@ -41,18 +41,20 @@ List of user capabilities:
`
caps := caps.GetUserCapsNames()
i := 0
count := 0
for _, v := range caps {
if (i == 0) {
usage += " "
}
usage += v + " "
i += 1
if (i >= 5) {
count += 1
if (i >= 5 && count < len(caps)) {
usage = u.AppendNewLine(usage)
i = 0
}
}
u.PrintErr(usage)
u.PrintlnErr(usage)
}
func (cmd *SetCaps)Run(args []string) int {
......
......@@ -43,18 +43,20 @@ List of VM access capabilities:
`
caps := caps.GetVMAccessCapsNames()
i := 0
count := 0
for _, v := range caps {
if (i == 0) {
usage += " "
}
usage += v + " "
i += 1
if (i >= 5) {
count += 1
if (i >= 5 && count < len(caps)) {
usage = u.AppendNewLine(usage)
i = 0
}
}
u.PrintErr(usage)
u.PrintlnErr(usage)
printRegexUsageDetails()
}
......
......@@ -7,7 +7,7 @@ import (
const (
major = 1
minor = 11
bugfix = 0
bugfix = 1
)
var version params.Version = params.NewVersion(major, minor, bugfix)
......
package caps
import (
"sort"
"errors"
)
......@@ -131,6 +132,12 @@ func GetUserCapsNames() []string {
for key, _ := range userCaps {
caps = append(caps, key)
}
// Sort caps by name
sort.Slice(caps, func(i, j int) bool {
return caps[i] < caps[j]
})
return caps
}
......@@ -139,5 +146,11 @@ func GetVMAccessCapsNames() []string {
for key, _ := range vmAccessCaps {
caps = append(caps, key)
}
// Sort caps by name
sort.Slice(caps, func(i, j int) bool {
return caps[i] < caps[j]
})
return caps
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment