Skip to content

cvd: Better help for load and start subcommands#2605

Merged
jemoreira merged 10 commits into
google:mainfrom
jemoreira:flags
May 28, 2026
Merged

cvd: Better help for load and start subcommands#2605
jemoreira merged 10 commits into
google:mainfrom
jemoreira:flags

Conversation

@jemoreira

Copy link
Copy Markdown
Member

Added a default implementation of DetailedHelp that prints in the same format for all commands (unless they override it, which most still do):

cvd `CmdList()[0]` - `SummaryHelp()`

`Description()`

`Flags()`

Both load and start make use of that default implementation.

Added more information and missing flags to both command's help output.

Some QoL improvements to the load command.

@jemoreira jemoreira requested a review from Databean May 23, 2026 00:48
@jemoreira jemoreira enabled auto-merge May 23, 2026 00:48
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/command_handler.h Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/command_handler.cpp Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/help_helpers.cpp Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/BUILD.bazel Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/parser/load_configs_parser.h Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/parser/flags_parser_test.cc Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/load_configs.cpp Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/load_configs.cpp Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/load_configs.cpp
@jemoreira jemoreira requested review from Databean and removed request for Databean May 27, 2026 22:11
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/help_format.cpp Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/commands/command_handler.h Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/parser/flags_parser_test.cc Outdated
Comment thread base/cvd/cuttlefish/host/commands/cvd/cli/parser/flags_parser_test.cc Outdated
jemoreira added 10 commits May 27, 2026 17:44
that compares flag names.
New virtual functions for description and flags are added to the base
command handler class, with default implementation since not all
subcommands implement them yet.

The default implementation of DetailedHelp will ensure all help messages
will have the same style.
Not all command handlers will be able to use the default help
implementation. They can still reuse some of the lower level utitlities
by exposing those in a library.
By adding a marker to the string that the helper removes, but otherwise
leaves the input string unmodified.
Use the default DetailedHelp implmentation for consistent formatting.

Add more details to the help text.
The credential_source and project_id flags are parsed into respective
string fields, only to later add them to the overrides list. This change
makes the setter and getter of those flags interact with the overrides
list directly.

Assisted-by: Gemini:Next
Overriding the same property in the same instance is likely an error, so
it's best to fail than produce unexpected results for the user.
@jemoreira jemoreira added this pull request to the merge queue May 28, 2026
Merged via the queue into google:main with commit 33b07be May 28, 2026
62 checks passed
@jemoreira jemoreira deleted the flags branch May 28, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants