Skip to content

bosornd/simple-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Shell

This project is a simple shell implementation in C++. It allows users to execute commands, handle input/output redirection, and manage background processes.

Class Diagram

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
Loading

Usage

  1. Clone the repository:

    git clone https://github.com/bosornd/simple-shell
    cd simple-shell
  2. Compile the source code:

    make
  3. Run the shell:

    ./simple-shell

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors