Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

MercuryShell (MShell) - The Refactoring Journey

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).


Technical Evolution: v1.0 vs 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

Engineering Highlights

1. Function Pointer Dispatch Table (v2.0)

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.

2. Recursive Directory Search

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.

3. Fuzzy Matching & Levenshtein Distance

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.


Demo

MercuryShell Demo

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages