feat: add generic table formatter (#3415)

This commit is contained in:
Dean Sheather
2022-08-18 02:28:22 +10:00
committed by GitHub
parent b1b2d1b2b2
commit a872330a8d
9 changed files with 619 additions and 36 deletions

View File

@ -59,7 +59,11 @@ func createUserStatusCommand(sdkStatus codersdk.UserStatus) *cobra.Command {
}
// Display the user
_, _ = fmt.Fprintln(cmd.OutOrStdout(), displayUsers(columns, user))
table, err := cliui.DisplayTable([]codersdk.User{user}, "", columns)
if err != nil {
return xerrors.Errorf("render user table: %w", err)
}
_, _ = fmt.Fprintln(cmd.OutOrStdout(), table)
// User status is already set to this
if user.Status == sdkStatus {