fix: display full account name in list
Show the full names of the accounts of a list instead of their account IDs
This commit is contained in:
parent
bff1eba972
commit
5cf6116fe8
2 changed files with 5 additions and 3 deletions
|
@ -220,7 +220,7 @@ func (c *ShowExecutor) showList(gtsClient *client.Client) error {
|
||||||
if len(accounts) > 0 {
|
if len(accounts) > 0 {
|
||||||
accountMap := make(map[string]string)
|
accountMap := make(map[string]string)
|
||||||
for i := range accounts {
|
for i := range accounts {
|
||||||
accountMap[accounts[i].ID] = accounts[i].Username
|
accountMap[accounts[i].Acct] = accounts[i].Username
|
||||||
}
|
}
|
||||||
|
|
||||||
list.Accounts = accountMap
|
list.Accounts = accountMap
|
||||||
|
|
|
@ -105,17 +105,19 @@ func (l List) Display(noColor bool) string {
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(l.Accounts) > 0 {
|
if len(l.Accounts) > 0 {
|
||||||
for id, name := range l.Accounts {
|
for acct, name := range l.Accounts {
|
||||||
output += fmt.Sprintf(
|
output += fmt.Sprintf(
|
||||||
"\n • %s (%s)",
|
"\n • %s (%s)",
|
||||||
utilities.DisplayNameFormat(noColor, name),
|
utilities.DisplayNameFormat(noColor, name),
|
||||||
id,
|
acct,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
output += "\n None"
|
output += "\n None"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output += "\n"
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue