From 0412826dd518d8ad3a259cf05bb6b2cd542eb797 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Dec 2022 13:05:44 +0100 Subject: [PATCH] refactor: change ce | ee to v | prefix for shell prompt reason: 'ce' (Community Edition) is only for internal use, when it comes to user/customer facing descriptions, we should use Opensource edition and Enterprise edition. Similary, for user/customer facing shell prompt, use `v` for Opensource edition and `e` for Enterprise --- apps/emqx_machine/src/emqx_restricted_shell.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/emqx_machine/src/emqx_restricted_shell.erl b/apps/emqx_machine/src/emqx_restricted_shell.erl index 31ee16986..f5a52809f 100644 --- a/apps/emqx_machine/src/emqx_restricted_shell.erl +++ b/apps/emqx_machine/src/emqx_restricted_shell.erl @@ -45,10 +45,14 @@ set_prompt_func() -> prompt_func(PropList) -> Line = proplists:get_value(history, PropList, 1), Version = emqx_release:version(), - Edition = emqx_release:edition(), + Prefix = + case emqx_release:edition() of + ce -> "v"; + ee -> "e" + end, case is_alive() of - true -> io_lib:format(<<"~ts-~ts(~s)~w> ">>, [Edition, Version, node(), Line]); - false -> io_lib:format(<<"~ts-~ts ~w> ">>, [Edition, Version, Line]) + true -> io_lib:format(<<"~ts~ts(~s)~w> ">>, [Prefix, Version, node(), Line]); + false -> io_lib:format(<<"~ts~ts ~w> ">>, [Prefix, Version, Line]) end. local_allowed(MF, Args, State) ->