Files
emcli/internal/cli/dispatch.go
T

31 lines
622 B
Go

package cli
import (
"encoding/base64"
"strconv"
)
func b64(b []byte) string { return base64.StdEncoding.EncodeToString(b) }
func uitoa(u uint32) string { return strconv.FormatUint(uint64(u), 10) }
func uintSlice(us []uint32) []uint64 {
out := make([]uint64, len(us))
for i, u := range us {
out[i] = uint64(u)
}
return out
}
// normalizeVerb maps verb aliases to their canonical form. Applied at the
// subcommand-verb position of every admin group and at the top-level command.
func normalizeVerb(v string) string {
switch v {
case "rm", "del":
return "remove"
case "ls":
return "list"
}
return v
}