From 2e3b6f3245030316b2d67c71daa1989b21cb9c9c Mon Sep 17 00:00:00 2001 From: Nathan Hoad Date: Mon, 13 Apr 2026 10:26:34 -0400 Subject: [PATCH] rgw: Add documentation for the --pretty-format option Fixes: http://tracker.ceph.com/issues/75988 Signed-off-by: Nathan Hoad --- doc/man/8/radosgw-admin.rst | 6 ++++++ src/rgw/radosgw-admin/radosgw-admin.cc | 3 ++- src/test/cli/radosgw-admin/help.t | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/man/8/radosgw-admin.rst b/doc/man/8/radosgw-admin.rst index 163dcc89e0d8..57826dfd900a 100644 --- a/doc/man/8/radosgw-admin.rst +++ b/doc/man/8/radosgw-admin.rst @@ -820,6 +820,12 @@ Options Specify output format for certain operations. Supported formats: xml, json. +.. option:: --pretty-format + + Enable pretty formatting for JSON/XML output with indentation and newlines. + If no format is specified, default is true. Use ``--format `` to disable + for more compact output. + .. option:: --sync-stats Option for the 'user stats' command. When specified, it will update user stats with diff --git a/src/rgw/radosgw-admin/radosgw-admin.cc b/src/rgw/radosgw-admin/radosgw-admin.cc index 4e2c39d6a9cf..f8986f49f7fd 100644 --- a/src/rgw/radosgw-admin/radosgw-admin.cc +++ b/src/rgw/radosgw-admin/radosgw-admin.cc @@ -459,7 +459,8 @@ void usage() cout << " --bucket-index-max-shards override a zone/zonegroup's default bucket index shard count\n"; cout << " --fix besides checking bucket index, will also fix it\n"; cout << " --check-objects bucket check: rebuilds bucket index according to actual objects state\n"; - cout << " --format= specify output format for certain operations: xml, json\n"; + cout << " --format= specify output format for certain operations: xml, json (default: json)\n"; + cout << " --pretty-format enable pretty formatting for json/xml output\n"; cout << " --purge-data when specified, user removal will also purge all the\n"; cout << " user data\n"; cout << " --purge-keys when specified, subuser removal will also purge all the\n"; diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t index fb68f164e344..f6744bb216b7 100644 --- a/src/test/cli/radosgw-admin/help.t +++ b/src/test/cli/radosgw-admin/help.t @@ -319,7 +319,8 @@ --bucket-index-max-shards override a zone/zonegroup's default bucket index shard count --fix besides checking bucket index, will also fix it --check-objects bucket check: rebuilds bucket index according to actual objects state - --format= specify output format for certain operations: xml, json + --format= specify output format for certain operations: xml, json (default: json) + --pretty-format enable pretty formatting for json/xml output --purge-data when specified, user removal will also purge all the user data --purge-keys when specified, subuser removal will also purge all the -- 2.47.3