From da04a0d161034ae104b941aa5e5a44000f5591ca Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 8 Jan 2023 15:16:54 +0100 Subject: [PATCH] remove logout and t command --- src/console.cpp | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/console.cpp b/src/console.cpp index cb16dd24b..e436b0c6d 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -67,9 +67,9 @@ static std::vector log_level_autocomplete(Shell & shell, const std: static void setup_commands(std::shared_ptr & commands) { // add for all contexts - // console, exit, help, logout + // log, exit, help for (unsigned int context = ShellContext::MAIN; context < ShellContext::END; context++) { - commands->add_command(context, CommandFlags::USER, {F_(console), F_(log)}, {F_(log_level_optional)}, console_log_level, log_level_autocomplete); + commands->add_command(context, CommandFlags::USER, {F_(log)}, {F_(log_level_optional)}, console_log_level, log_level_autocomplete); commands->add_command(context, CommandFlags::USER, @@ -78,7 +78,7 @@ static void setup_commands(std::shared_ptr & commands) { commands->add_command(context, CommandFlags::USER, {F_(help)}, EMSESPShell::main_help_function); - commands->add_command(context, CommandFlags::USER, {F_(logout)}, EMSESPShell::main_logout_function); + // commands->add_command(context, CommandFlags::USER, {F_(logout)}, EMSESPShell::main_logout_function); } /* example of going into a new context @@ -140,7 +140,7 @@ static void setup_commands(std::shared_ptr & commands) { // #if defined(EMSESP_DEBUG) - // create commands test and t + // create commands test commands->add_command(ShellContext::MAIN, CommandFlags::USER, string_vector{"test"}, @@ -155,10 +155,6 @@ static void setup_commands(std::shared_ptr & commands) { } }); - commands->add_command(ShellContext::MAIN, CommandFlags::USER, string_vector{("t")}, [](Shell & shell, const std::vector & arguments) { - Test::run_test(shell, "default"); - }); - commands->add_command(ShellContext::MAIN, CommandFlags::USER, string_vector{F_(debug)}, @@ -710,11 +706,12 @@ std::string EMSESPShell::prompt_suffix() { } void EMSESPShell::end_of_transmission() { - if (context() != ShellContext::MAIN || has_flags(CommandFlags::ADMIN)) { - invoke_command(F_(exit)); - } else { - invoke_command(F_(logout)); - } + invoke_command(F_(exit)); + // if (context() != ShellContext::MAIN || has_flags(CommandFlags::ADMIN)) { + // invoke_command(F_(exit)); + // } else { + // invoke_command(F_(logout)); + // } } void EMSESPShell::generic_exit_context_function(Shell & shell, const std::vector & arguments) { @@ -733,13 +730,6 @@ void EMSESPShell::main_exit_function(Shell & shell, const std::vector & arguments) { - if (shell.has_flags(CommandFlags::ADMIN)) { - EMSESPShell::main_exit_admin_function(shell, NO_ARGUMENTS); - } - EMSESPShell::main_exit_user_function(shell, NO_ARGUMENTS); -}; - void EMSESPShell::main_exit_user_function(Shell & shell, const std::vector & arguments) { shell.stop(); };