File tree Expand file tree Collapse file tree 2 files changed +7
-41
lines changed
Expand file tree Collapse file tree 2 files changed +7
-41
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ import { logger } from "../logger";
44import * as metrics from "../metrics" ;
55import { requireAuth } from "../user" ;
66import { getValidBindingName } from "../utils/getValidBindingName" ;
7+ import formatLabelledValues from "../utils/render-labelled-values" ;
78import { LOCATION_CHOICES } from "./constants" ;
89import {
910 createR2Bucket ,
1011 deleteR2Bucket ,
1112 isValidR2BucketName ,
1213 listR2Buckets ,
14+ tablefromR2BucketsListResponse ,
1315 updateR2BucketStorageClass ,
1416} from "./helpers" ;
1517
@@ -172,12 +174,11 @@ defineCommand({
172174 async handler ( args , { config } ) {
173175 const accountId = await requireAuth ( config ) ;
174176
175- logger . log (
176- JSON . stringify ( await listR2Buckets ( accountId , args . jurisdiction ) , null , 2 )
177- ) ;
178- await metrics . sendMetricsEvent ( "list r2 buckets" , {
179- sendMetrics : config . send_metrics ,
180- } ) ;
177+ logger . log ( `Listing buckets...` ) ;
178+
179+ const buckets = await listR2Buckets ( accountId , args . jurisdiction ) ;
180+ const tableOutput = tablefromR2BucketsListResponse ( buckets ) ;
181+ logger . log ( tableOutput . map ( ( x ) => formatLabelledValues ( x ) ) . join ( "\n\n" ) ) ;
181182 } ,
182183} ) ;
183184
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments