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 {
|
||||
accountMap := make(map[string]string)
|
||||
for i := range accounts {
|
||||
accountMap[accounts[i].ID] = accounts[i].Username
|
||||
accountMap[accounts[i].Acct] = accounts[i].Username
|
||||
}
|
||||
|
||||
list.Accounts = accountMap
|
||||
|
|
|
@ -105,17 +105,19 @@ func (l List) Display(noColor bool) string {
|
|||
)
|
||||
|
||||
if len(l.Accounts) > 0 {
|
||||
for id, name := range l.Accounts {
|
||||
for acct, name := range l.Accounts {
|
||||
output += fmt.Sprintf(
|
||||
"\n • %s (%s)",
|
||||
utilities.DisplayNameFormat(noColor, name),
|
||||
id,
|
||||
acct,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
output += "\n None"
|
||||
}
|
||||
|
||||
output += "\n"
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue