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 Featurev1.0 (Initial Prototype)v2.0 (Modular Refactor)
Command ProcessingProcedural if-else LogicFunction Pointer Dispatch Table
ArchitectureMonolithic (Spaghetti)Modular & Data-Driven
File SearchingBasic Directory ListingRecursive Deep Search
Error HandlingStatic Error MessagesLevenshtein-based Fuzzy Matching
File SupportPlain Text (ASCII) OnlyText & 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