59 const std::span<const std::string> &vArgs,
107 const std::span<const std::string> &vArgs,
Retrieves the value of an local variable.
Definition command_var.h:38
shell_status run(const std::span< const std::string > &vArgs, shell_session &oSession) const override
Prints the local variable value on stdout. If the local variable does not exist, does nothing.
Definition command_var.cpp:33
virtual void msg_error_param_number(std::ostream &oStdErr, std::size_t nArgs) const
Print an error if the wrong number of arguments is provided.
Definition command_var.cpp:53
command_getvar()
Constructs command.
Definition command_var.h:43
virtual void msg_error_variable_name(std::ostream &oStdErr, const std::string &sVariableName) const
Print an error if variable name is invalid.
Definition command_var.cpp:57
Sets the value of a local variable.
Definition command_var.h:86
shell_status run(const std::span< const std::string > &vArgs, shell_session &oSession) const override
Sets the local variable value. If the local variable does not exist, creates it.
Definition command_var.cpp:61
virtual void msg_error_variable_name(std::ostream &oStdErr, const std::string &sVariableName) const
Print an error if variable name is invalid.
Definition command_var.cpp:85
command_setvar()
Constructs command.
Definition command_var.h:91
virtual void msg_error_param_number(std::ostream &oStdErr, std::size_t nArgs) const
Print an error if the wrong number of arguments is provided.
Definition command_var.cpp:81
Abstract base class for all shell commands.
Definition command.h:50
Represents an execution environment for a shell instance.
Definition shell_session.h:57
Defines the bs::command interface and built-in shell commands.
BashSpark main namespace.
Definition command.h:39
shell_status
Shell status codes.
Definition shell_status.h:47