From e7b8df6ba9591abd15d89debe703c072af2e939c Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Tue, 31 Jan 2023 12:46:37 +0100 Subject: [PATCH] chore(bin/emqx): hide upgrade/downgrade from usage info --- bin/emqx | 12 ++++++------ bin/install_upgrade.escript | 21 ++++++--------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/bin/emqx b/bin/emqx index ebf10bada..2c2609b36 100755 --- a/bin/emqx +++ b/bin/emqx @@ -159,7 +159,7 @@ usage() { echo "Evaluate an Erlang expression in the EMQX node, even on Elixir node" ;; versions) - echo "List installed EMQX versions and their status" + echo "List installed EMQX release versions and their status" ;; unpack) echo "Usage: $REL_NAME unpack [VERSION]" @@ -217,12 +217,12 @@ usage() { echo " ctl: Administration commands, execute '$REL_NAME ctl help' for more details" echo '' echo "More:" - echo " Shell attach: remote_console | attach" - echo " Up/Down-grade: upgrade | downgrade | install | uninstall" - echo " Install info: ertspath | root_dir" - echo " Runtime info: pid | ping | versions" + echo " Shell attach: remote_console | attach" +# echo " Up/Down-grade: upgrade | downgrade | install | uninstall | versions" # TODO enable when supported + echo " Install Info: ertspath | root_dir" + echo " Runtime Status: pid | ping" echo " Validate Config: check_config" - echo " Advanced: console_clean | escript | rpc | rpcterms | eval | eval-erl" + echo " Advanced: console_clean | escript | rpc | rpcterms | eval | eval-erl" echo '' echo "Execute '$REL_NAME COMMAND help' for more information" ;; diff --git a/bin/install_upgrade.escript b/bin/install_upgrade.escript index f7f340f31..3e39c787b 100755 --- a/bin/install_upgrade.escript +++ b/bin/install_upgrade.escript @@ -18,27 +18,18 @@ main([Command0, DistInfoStr | CommandArgs]) -> Opts = parse_arguments(CommandArgs), %% invoke the command passed as argument F = case Command0 of - %% "install" -> fun(A, B) -> install(A, B) end; - %% "unpack" -> fun(A, B) -> unpack(A, B) end; - %% "upgrade" -> fun(A, B) -> upgrade(A, B) end; - %% "downgrade" -> fun(A, B) -> downgrade(A, B) end; - %% "uninstall" -> fun(A, B) -> uninstall(A, B) end; - "versions" -> fun(A, B) -> versions(A, B) end; - _ -> fun fail_upgrade/2 + "install" -> fun(A, B) -> install(A, B) end; + "unpack" -> fun(A, B) -> unpack(A, B) end; + "upgrade" -> fun(A, B) -> upgrade(A, B) end; + "downgrade" -> fun(A, B) -> downgrade(A, B) end; + "uninstall" -> fun(A, B) -> uninstall(A, B) end; + "versions" -> fun(A, B) -> versions(A, B) end end, F(DistInfo, Opts); main(Args) -> ?INFO("unknown args: ~p", [Args]), erlang:halt(1). -%% temporary block for hot-upgrades; next release will just remove -%% this and the new script version shall be used instead of this -%% current version. -%% TODO: always deny relup for macos (unsupported) -fail_upgrade(_DistInfo, _Opts) -> - ?ERROR("Unsupported upgrade path", []), - erlang:halt(1). - unpack({RelName, NameTypeArg, NodeName, Cookie}, Opts) -> TargetNode = start_distribution(NodeName, NameTypeArg, Cookie), Version = proplists:get_value(version, Opts),