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

This commit is contained in:
Dean Sheather
2023-02-08 17:09:38 +00:00
committed by GitHub
parent 5655ec6862
commit d60ec3e4bf
36 changed files with 851 additions and 285 deletions
+3 -1
View File
@@ -55,6 +55,8 @@ func featuresList() *cobra.Command {
return err
}
// This uses custom formatting as the JSON output outputs an object
// as opposed to a list from the table output.
out := ""
switch outputFormat {
case "table", "":
@@ -88,7 +90,7 @@ func featuresList() *cobra.Command {
}
type featureRow struct {
Name codersdk.FeatureName `table:"name"`
Name codersdk.FeatureName `table:"name,default_sort"`
Entitlement string `table:"entitlement"`
Enabled bool `table:"enabled"`
Limit *int64 `table:"limit"`