Skip to content

Commit bc33ef9

Browse files
committed
[cli] Explain valid instance name format
When the requested instance name is invalid, say what the rules are and link to the instance name format reference instead of only echoing the rejected name. Fixes #4906
1 parent 2087091 commit bc33ef9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/client/cli/cmd/launch.cpp‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,14 @@ mp::ReturnCodeVariant cmd::Launch::request_launch(const ArgParser* parser)
598598
}
599599
else if (error == LaunchError::INVALID_HOSTNAME)
600600
{
601-
error_details =
602-
fmt::format("Invalid instance name supplied: {}", request.instance_name());
601+
error_details = fmt::format(
602+
"Invalid instance name supplied: {}\n"
603+
"Instance names must be valid, non-qualified host names: they may contain "
604+
"only alphanumeric characters and hyphens, must start with a letter, and "
605+
"must end with a letter or number. See "
606+
"https://canonical.com/multipass/docs/stable/reference/"
607+
"instance-name-format/",
608+
request.instance_name());
603609
}
604610
else if (error == LaunchError::INVALID_NETWORK)
605611
{

0 commit comments

Comments
 (0)