How zanostro/shell works
This repository is a small, single-file command shell. Its principal workflow is user input, command parsing and execution, then output or side effects. The excerpt shows built-in commands for files and directories, system information, and shell utilities, as well as pipelines and process waiting. Because the excerpts omit much of the main loop and command-dispatch code, the input-to-dispatch relationships are shown as unverified rather than asserted as source-backed calls.
Main entry points: shell.cpp Command execution
Components 11
Shell runtime
- Interactive loop
shell.cpp - Command tokenizer
shell.cpp - Command execution
shell.cpp
Built-in commands
- File commands
shell.cpp - Directory commands
shell.cpp - System commands
shell.cpp - Shell utilities
shell.cpp
Process execution
- Pipeline runner
shell.cpp - Child processes
Other components
- Shell user
- OS and filesystem
Connections 15
- Shell user → Interactive loop: enters commands
- Interactive loop → Command tokenizer: parses input
shell.cpp - Command tokenizer → Command execution: dispatches command
shell.cpp - Command execution → File commands: runs builtin
shell.cpp - Command execution → Directory commands: runs builtin
shell.cpp - Command execution → System commands: runs builtin
shell.cpp - Command execution → Shell utilities: runs builtin
shell.cpp - Command execution → Pipeline runner: runs pipeline
shell.cpp - Pipeline runner → Child processes: forks processes
shell.cpp - Pipeline runner → Child processes: executes commands
shell.cpp - Pipeline runner → OS and filesystem: connects pipes
shell.cpp - File commands → OS and filesystem: changes files
shell.cpp - Directory commands → OS and filesystem: changes directories
shell.cpp - System commands → OS and filesystem: reads system info
shell.cpp - Shell utilities → OS and filesystem: reads and writes
shell.cpp