How kibet-rotich/shell-using-c- works
This repository is a small C++ shell starter. Its runtime workflow reads a command line, tokenizes it, applies stdout redirection when requested, dispatches builtins or an external command, then restores stdout. Builtins cover exit, type lookup, echo, working-directory display, and directory changes; external commands are resolved through PATH and run in a child process. The only substantial runtime source is src/main.cpp, so the graph keeps these responsibilities together. Relationships are supported by that excerpt; external command execution is shown as process interaction.
Main entry points: main.cpp Command dispatch
Components 9
Shell runtime
- Shell loop
src/main.cpp - Command tokenizer
src/main.cpp - Command dispatch
src/main.cpp - Builtin commands
src/main.cpp - Stdout redirection
src/main.cpp - PATH resolver
src/main.cpp
Host environment
- External process
src/main.cpp - Environment and filesystem
Other components
- Shell user
Connections 12
- Shell user → Shell loop: enters command
README.md - Shell loop → Command tokenizer: tokenizes input
src/main.cpp - Shell loop → Stdout redirection: extracts redirect
src/main.cpp - Shell loop → Command dispatch: dispatches command
src/main.cpp - Command dispatch → Builtin commands: calls builtin
src/main.cpp - Command dispatch → PATH resolver: calls for external
src/main.cpp - Command dispatch → PATH resolver: type lookup
src/main.cpp - PATH resolver → Environment and filesystem: reads PATH
src/main.cpp - Builtin commands → Environment and filesystem: changes or reads cwd
src/main.cpp - Command dispatch → External process: forks and executes
src/main.cpp - External process → Environment and filesystem: runs resolved program
src/main.cpp - Stdout redirection → Environment and filesystem: opens output file
src/main.cpp