diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-09-11 16:19:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 17:19:45 +0200 |
commit | c64aa50c0e4219ef623a6ec3b939ac10a4568563 (patch) | |
tree | 09b39756212f765e713d44a0f82b9f85958f0ded /cli/args/flags.rs | |
parent | aae3a6bcb41fdb305d61a95f176be0db1513c56e (diff) |
feat(upgrade): better error message on failure (#25503)
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index fbf58fff2..6d2611749 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -2986,12 +2986,8 @@ The declaration file could be saved and used for typing information.", ) } -fn upgrade_subcommand() -> Command { - command( - "upgrade", - cstr!("Upgrade deno executable to the given version. - -<g>Latest</> +pub static UPGRADE_USAGE: &str = cstr!( + "<g>Latest</> <bold>deno upgrade</> <g>Specific version</> @@ -3002,7 +2998,15 @@ fn upgrade_subcommand() -> Command { <g>Channel</> <bold>deno upgrade</> <p(245)>stable</> <bold>deno upgrade</> <p(245)>rc</> - <bold>deno upgrade</> <p(245)>canary</> + <bold>deno upgrade</> <p(245)>canary</>" +); + +fn upgrade_subcommand() -> Command { + command( + "upgrade", + color_print::cformat!("Upgrade deno executable to the given version. + +{} The version is downloaded from <p(245)>https://dl.deno.land</> and is used to replace the current executable. @@ -3010,7 +3014,7 @@ If you want to not replace the current Deno executable but instead download an u different location, use the <c>--output</> flag: <p(245)>deno upgrade --output $HOME/my_deno</> -<y>Read more:</> <c>https://docs.deno.com/go/cmd/upgrade</>"), +<y>Read more:</> <c>https://docs.deno.com/go/cmd/upgrade</>", UPGRADE_USAGE), UnstableArgsConfig::None, ) .hide(cfg!(not(feature = "upgrade"))) |