ch-remote: Make snapshot and restore config arguments required

The snapshot and restore subcommands in ch-remote had optional
snapshot_config and restore_config arguments, but the implementation was
unconditionally unwrapping them.

This change marks these arguments as required to handle the missing
argument validation and report a proper error message instead of letting
the application panic.

Signed-off-by: Andrei Vagin <avagin@google.com>
This commit is contained in:
Andrei Vagin
2026-05-29 01:04:12 +00:00
committed by Rob Bradford
parent 14717a94a3
commit 1b0dfc0da3

View File

@@ -1127,6 +1127,7 @@ fn get_cli_commands_sorted() -> Box<[Command]> {
.arg(
Arg::new("restore_config")
.index(1)
.required(true)
.help(RestoreConfig::SYNTAX),
),
Command::new("resume").about("Resume the VM"),
@@ -1144,6 +1145,7 @@ fn get_cli_commands_sorted() -> Box<[Command]> {
.arg(
Arg::new("snapshot_config")
.index(1)
.required(true)
.help("<destination_url>"),
),
]