Skip to content

Commit

Permalink
userctl print format
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Nov 3, 2023
1 parent 1180062 commit c92701b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/userctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"os"
"strings"

"golang.org/x/crypto/bcrypt"
"gopkg.in/yaml.v3"
Expand Down Expand Up @@ -49,8 +50,11 @@ func main() {
flag.Parse()

if *user == "" {
fmt.Printf("%-20s %-15s %-8s %-12s %-8s %s\n", "Login", "Callsign", "Team", "Role", "Scope", "Read scope")
fmt.Println(strings.Repeat("-", 90))
for _, user := range users {
fmt.Printf("%s\t%s\t%s\t%s\n", user.Login, user.Callsign, user.Team, user.Role)
fmt.Printf("%-20s %-15s %-8s %-12s %-8s %s\n",
user.Login, user.Callsign, user.Team, user.Role, user.Scope, strings.Join(user.ReadScope, ","))
}
return
}
Expand Down

0 comments on commit c92701b

Please sign in to comment.