From 79bc82e3650ad1f8b5cd623fa509e6d29977dd2a Mon Sep 17 00:00:00 2001 From: phanes Date: Thu, 16 Feb 2023 03:27:16 -0500 Subject: [PATCH] shell attribute fix --- src/config/Config.cpp | 2 +- src/lcpex/liblcpex.cpp | 3 ++- src/shells/shells.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/config/Config.cpp b/src/config/Config.cpp index ad0ef24..7dd3c1f 100644 --- a/src/config/Config.cpp +++ b/src/config/Config.cpp @@ -231,7 +231,7 @@ void Conf::load_shells() { { tmp_S.load_root( jbuff[index] ); this->shells.push_back( tmp_S ); - this->slog.log_task( E_DEBUG, "SHELLS", "Loaded shell: '" + tmp_S.name + "'" ); + this->slog.log_task( E_DEBUG, "SHELLS", "Loaded shell: '" + tmp_S.name + "' (" + tmp_S.path + ")" ); } } diff --git a/src/lcpex/liblcpex.cpp b/src/lcpex/liblcpex.cpp index 27c2529..75da59a 100644 --- a/src/lcpex/liblcpex.cpp +++ b/src/lcpex/liblcpex.cpp @@ -16,7 +16,8 @@ std::string prefix_generator( prefix = shell_path; // if the shell takes an argument to execute a command, add it enclosed in quotes - if (shell_execution_arg != "") { + if ( shell_execution_arg != "" ) + { // add the execution arg prefix += " " + shell_execution_arg + " "; } else { diff --git a/src/shells/shells.cpp b/src/shells/shells.cpp index 8c7aa32..2179454 100644 --- a/src/shells/shells.cpp +++ b/src/shells/shells.cpp @@ -54,11 +54,11 @@ int Shell::load_root( Json::Value loader_root ) throw ShellException("No execution_arg attribute specified when loading a shell definition."); } - if ( loader_root.isMember("execution_arg") ) + if ( loader_root.isMember("source_cmd") ) { - this->execution_arg = loader_root.get( "execution_arg", errmsg ).asString(); + this->source_cmd = loader_root.get( "source_cmd", errmsg ).asString(); } else { - throw ShellException("No execution_arg attribute specified when loading a shell definition."); + throw ShellException("No source_cmd attribute specified when loading a shell definition."); } return 0; } \ No newline at end of file