Skip to content

About

Self-contained C++17 command interpreter with in-program commands, pipelines, redirection, batch execution, and a command factory.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ CLI Interpreter

An interactive command interpreter with command parsing, pipelines, input/output redirection, batch execution, and a command factory.

Implemented commands include echo, wc, date, time, touch, truncate, rm, tr, head, and prompt.

Build and run

Requires a C++17 compiler and CMake 3.16 or later.

cmake -S . -B build
cmake --build build --config Release

Run build/cli-interpreter on Unix or build/Release/cli-interpreter.exe with a Visual Studio generator on Windows. Use end-of-input (Ctrl+D on Unix; Ctrl+Z then Enter on Windows) to leave the interpreter.

echo "Hello, world"
date
time
echo "one two three" | wc -w

Structure

  • include/: parser, command, execution-plan, and exception interfaces.
  • src/: command implementations, parsing, and the interpreter entry point.

Limitations

This is a custom educational interpreter, not a complete operating-system shell. Commands and parsing rules follow the assignment. Input lines may contain at most 512 characters. Longer lines are rejected and consumed in full so the next command starts cleanly.

Regression checks

After building, run python tests/smoke.py build/Release/cli-interpreter.exe on Windows, or pass build/cli-interpreter on Unix. Python 3 is needed only for this check. The checks cover pipelines, final input without a newline, the 512-character boundary, recovery after an oversized line, and file redirection.

Context

Educational project by Marko Mijanovic, University of Belgrade, School of Electrical Engineering. Supplied course scaffolding and assets retain their original licensing terms.

Verification

  • CMake/MSVC Release build passed.
  • Regression checks passed: pipelines, EOF without newline, 512-character limit and recovery, and output redirection.

About

Self-contained C++17 command interpreter with in-program commands, pipelines, redirection, batch execution, and a command factory.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages