59 : m_sName(std::move(sName)) {
77 const std::span<const std::string> &vArgs,
134 const std::span<const std::string> &vArgs,
165 const std::span<const std::string> &vArgs,
Built-in command that prints all arguments to stdout.
Definition command.h:111
command_echo()
Constructs the command.
Definition command.h:116
shell_status run(const std::span< const std::string > &vArgs, shell_session &oSession) const override
Prints all arguments to stdout.
Definition command.cpp:50
Built-in command that evaluates its arguments as a shell command.
Definition command.h:146
virtual void msg_error_max_depth_reached(std::ostream &oStdErr) const
Print an error if the depth limit of the shell is surpassed.
Definition command.cpp:114
command_eval()
Constructs the command.
Definition command.h:151
shell_status run(const std::span< const std::string > &vArgs, shell_session &oSession) const override
Execute the provided arguments as if typed in shell. The corresponding status code is returned.
Definition command.cpp:87
Abstract base class for all shell commands.
Definition command.h:50
command(std::string sName)
Construct a command with a given name.
Definition command.h:58
const std::string & get_name_ref() const noexcept
Get the command name (reference).
Definition command.h:94
virtual shell_status run(const std::span< const std::string > &vArgs, shell_session &oSession) const =0
Execute the command.
std::string get_name() const
Get the command name (copy).
Definition command.h:86
virtual ~command()=default
Virtual destructor.
Represents an execution environment for a shell instance.
Definition shell_session.h:57
A simplified shell environment inspired by Bash.
Definition shell.h:63
BashSpark main namespace.
Definition command.h:39
shell_status
Shell status codes.
Definition shell_status.h:47
Defines the class bs::shell_session.