mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-25 03:51:36 +01:00
Fix Login List Output (#150)
fix output Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/150 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
f1801f39a6
commit
3a382e73b1
20
cmd/login.go
20
cmd/login.go
@ -129,6 +129,7 @@ var cmdLoginList = cli.Command{
|
|||||||
Usage: "List Gitea logins",
|
Usage: "List Gitea logins",
|
||||||
Description: `List Gitea logins`,
|
Description: `List Gitea logins`,
|
||||||
Action: runLoginList,
|
Action: runLoginList,
|
||||||
|
Flags: []cli.Flag{&OutputFlag},
|
||||||
}
|
}
|
||||||
|
|
||||||
func runLoginList(ctx *cli.Context) error {
|
func runLoginList(ctx *cli.Context) error {
|
||||||
@ -137,10 +138,23 @@ func runLoginList(ctx *cli.Context) error {
|
|||||||
log.Fatal("Unable to load config file " + yamlConfigPath)
|
log.Fatal("Unable to load config file " + yamlConfigPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Name\tURL\tSSHHost\n")
|
headers := []string{
|
||||||
for _, l := range config.Logins {
|
"Name",
|
||||||
fmt.Printf("%s\t%s\t%s\n", l.Name, l.URL, l.GetSSHHost())
|
"URL",
|
||||||
|
"SSHHost",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var values [][]string
|
||||||
|
|
||||||
|
for _, l := range config.Logins {
|
||||||
|
values = append(values, []string{
|
||||||
|
l.Name,
|
||||||
|
l.URL,
|
||||||
|
l.GetSSHHost(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Output(outputValue, headers, values)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user