Skip to content

Commit dc7985b

Browse files
committed
Overhaul cvd help remove output
Bug: b/524685271 Assisted-by: Gemini
1 parent e576441 commit dc7985b

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

base/cvd/cuttlefish/host/commands/cvd/cli/commands/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ cf_cc_library(
294294
deps = [
295295
"//cuttlefish/flag_parser",
296296
"//cuttlefish/host/commands/cvd/cli:command_request",
297+
"//cuttlefish/host/commands/cvd/cli:help_format",
297298
"//cuttlefish/host/commands/cvd/cli:types",
298299
"//cuttlefish/host/commands/cvd/cli:utils",
299300
"//cuttlefish/host/commands/cvd/cli/commands:command_handler",

base/cvd/cuttlefish/host/commands/cvd/cli/commands/remove.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "cuttlefish/flag_parser/flag.h"
2727
#include "cuttlefish/host/commands/cvd/cli/command_request.h"
2828
#include "cuttlefish/host/commands/cvd/cli/commands/command_handler.h"
29+
#include "cuttlefish/host/commands/cvd/cli/help_format.h"
2930
#include "cuttlefish/host/commands/cvd/cli/selector/selector.h"
3031
#include "cuttlefish/host/commands/cvd/cli/types.h"
3132
#include "cuttlefish/host/commands/cvd/cli/utils.h"
@@ -43,15 +44,27 @@ cvd_common::Args RemoveCvdCommandHandler::CmdList() const {
4344
}
4445

4546
std::string RemoveCvdCommandHandler::SummaryHelp() const {
46-
return "Remove devices and artifacts from the system.";
47+
return "Remove instance groups and related artifacts from the system.";
4748
}
4849

49-
Result<std::string> RemoveCvdCommandHandler::DetailedHelp(
50-
const CommandRequest& request) {
51-
return "Removes selected devices from the system.\n\n"
52-
"Running devices are stopped first. Deletes build and runtime "
53-
"artifacts, including log files and images (only if downloaded by "
54-
"cvd itself)";
50+
std::vector<HelpParagraph> RemoveCvdCommandHandler::Description() const {
51+
return {
52+
HelpParagraph(
53+
"Removal consists of deleting the group's runtime directory (which "
54+
"includes log files and virtual disks), and removing the group "
55+
"from the CVD instance database. This operation completely removes "
56+
"any trace of the group from the system and cannot be undone."),
57+
HelpParagraph(
58+
"The `cvd remove` command operates on entire instance groups. Even "
59+
"if you target a specific instance using selector flags (e.g., "
60+
"`--instance_name`), the entire group containing that instance will "
61+
"be removed."),
62+
HelpParagraph(
63+
"If the selected instance group is running, the command will attempt "
64+
"to stop it first. If the instances cannot be stopped, the removal "
65+
"will fail. In this case, you may need to run `cvd reset` to "
66+
"clean up the system."),
67+
};
5568
}
5669

5770
bool RemoveCvdCommandHandler::RequiresDeviceExists() const { return true; }

base/cvd/cuttlefish/host/commands/cvd/cli/commands/remove.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RemoveCvdCommandHandler : public CvdCommandHandler {
3333

3434
std::string SummaryHelp() const override;
3535
bool RequiresDeviceExists() const override;
36-
Result<std::string> DetailedHelp(const CommandRequest& request) override;
36+
std::vector<HelpParagraph> Description() const override;
3737

3838
private:
3939
Result<void> StopGroup(LocalInstanceGroup& group) const;

0 commit comments

Comments
 (0)