feat: add JSON output format to many CLI commands (#6082)

This commit is contained in:
Dean Sheather
2023-02-09 04:09:38 +11:00
committed by GitHub
parent 5655ec6862
commit d60ec3e4bf
36 changed files with 851 additions and 285 deletions

View File

@ -58,7 +58,9 @@ func createUserStatusCommand(sdkStatus codersdk.UserStatus) *cobra.Command {
return xerrors.Errorf("fetch user: %w", err)
}
// Display the user
// Display the user. This uses cliui.DisplayTable directly instead
// of cliui.NewOutputFormatter because we prompt immediately
// afterwards.
table, err := cliui.DisplayTable([]codersdk.User{user}, "", columns)
if err != nil {
return xerrors.Errorf("render user table: %w", err)