This project is a simple shell implementation in C++. It allows users to execute commands, handle input/output redirection, and manage background processes.
classDiagram
namespace shell {
class ICommand {
+bool execute(const std::istringstream& args)
}
class Command {
+template ~typename T~ static void registerCommand(const std::string& name)
}
class Shell {
+static Shell& getInstance()
+void run()
-void registerCommand(const std::string& name, std::unique_ptr~ICommand~ command)
friend class Command
-std::unordered_map<std::string, std::unique_ptr~ICommand~> commandMap
}
}
namespace command {
class HelpCommand {
+bool execute(const std::istringstream& args)
}
class ExitCommand {
+bool execute(const std::istringstream& args)
}
}
Shell --> ICommand
ICommand <|-- Command
Command <|-- HelpCommand
Command <|-- ExitCommand
-
Clone the repository:
git clone https://github.com/bosornd/simple-shell cd simple-shell -
Compile the source code:
make
-
Run the shell:
./simple-shell
This project is licensed under the MIT License.