From: Igor Fedotov Date: Thu, 5 Sep 2024 19:01:01 +0000 (+0300) Subject: tools/ceph-bluestore-tool: fix "--yes-i-really-really-mean-it" option X-Git-Tag: v19.2.1~193^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc0f0897ce1d1451258d6c32b6ca80361cfe1cc7;p=ceph.git tools/ceph-bluestore-tool: fix "--yes-i-really-really-mean-it" option Fixes: https://tracker.ceph.com/issues/67926 Signed-off-by: Igor Fedotov (cherry picked from commit c266ef0f61f7de29b56119171625dd61b8c0f0a2) Conflicts: 'trim' option was not present, but --yes-i-really-really-mean-it was used --- diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index b1cc5807dfd1..a478efc27784 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -307,6 +307,7 @@ int main(int argc, char **argv) ("key,k", po::value(&key), "label metadata key name") ("value,v", po::value(&value), "label metadata value") ("allocator", po::value>(&allocs_name), "allocator to inspect: 'block'/'bluefs-wal'/'bluefs-db'") + ("yes-i-really-really-mean-it", "additional confirmation for dangerous commands") ("sharding", po::value(&new_sharding), "new sharding to apply") ("resharding-ctrl", po::value(&resharding_ctrl), "gives control over resharding procedure details") ; @@ -345,7 +346,11 @@ int main(int argc, char **argv) po::variables_map vm; try { po::parsed_options parsed = - po::command_line_parser(argc, argv).options(po_all).allow_unregistered().run(); + po::command_line_parser(argc, argv).options(po_all) + .allow_unregistered() + .style(po::command_line_style::default_style & + ~po::command_line_style::allow_guessing) + .run(); po::store( parsed, vm); po::notify(vm); ceph_option_strings = po::collect_unrecognized(parsed.options,