MercuryShell (MShell) is a high-performance Command Line Interface (CLI) simulation developed in C with native Windows API integration. This project represents a software engineering evolution, showcasing the transition from a basic functional prototype to a professional, modular architecture (v1.0 → v2.0).
The core focus of this project was to move beyond "code that just works" toward scalable, optimized, and maintainable software design.
| Technical Feature | v1.0 (Initial Prototype) | v2.0 (Modular Refactor) |
|---|---|---|
| Command Processing | Procedural if-else Logic |
Function Pointer Dispatch Table |
| Architecture | Monolithic (Spaghetti) | Modular & Data-Driven |
| File Searching | Basic Directory Listing | Recursive Deep Search |
| Error Handling | Static Error Messages | Levenshtein-based Fuzzy Matching |
| File Support | Plain Text (ASCII) Only | Text & Binary (Hex Dump) Support |
In v2, I eliminated the massive if-else blocks from v1. By implementing a Command structure and a function pointer array (void(*CommandFunc)(const char* args)), I achieved O(1) or O(n) command lookup complexity. This significantly improves readability and allows for seamless scalability.
The searchfile_rec function utilizes the WIN32_FIND_DATAA structure to traverse the Windows file system recursively. This enables the shell to find files deep within subdirectories, providing a powerful search capability across the entire directory tree.
To enhance User Experience (UX), I integrated the Levenshtein Distance algorithm. If a user enters a typo (e.g., helpp), the shell calculates the "distance" between the input and valid commands to provide an intelligent "Did you mean?" suggestion.
