summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2025-08-14 16:48:06 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2025-08-14 16:48:06 +0200
commitfa2069cc7e80d491cf19bb7ad9e11d97356882b9 (patch)
tree22c41c9df159a694bb4cfadcf3c6a93be1c9d120
parent01a8fecbabdf0a43deee3eddabca4faba487ffe7 (diff)
CLAUDE.md: Update.
-rw-r--r--CLAUDE.md58
1 files changed, 55 insertions, 3 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 0ad2606..4a470ad 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -39,6 +39,14 @@ The application uses a type-safe command architecture with Zig unions and enums:
- **`InputSource`**: Manages input redirection from files with line-by-line processing
- **`OutputCapture`**: Buffers command output for redirection to files
+### Modular Command Architecture
+The project now uses a fully modularized command architecture where each DOS command is implemented in its own file:
+
+- **`src/cmd/`**: Directory containing individual command implementations
+- **Command Pattern**: Each command implements an `eval()` method with consistent signature
+- **Type Safety**: Commands are strongly typed Zig structs with compile-time guarantees
+- **Shared Types**: Common types defined in `src/cmd/lib/types.zig` for consistency
+
### Implementation Status
#### ✅ **Fully Implemented Features**
@@ -51,14 +59,28 @@ The application uses a type-safe command architecture with Zig unions and enums:
- **Path Formatting**: DOS-style path display with drive letters and 8.3 filename conversion
#### 📋 **Built-in Commands Available**
+
+**Phase 1 Commands (Core):**
+- **`COPY`** - File copying with overwrite prompts and device handling
+- **`DIR`** - Directory listing with file sizes, counts, and free space display
+- **`TYPE`** - Display file contents with binary character filtering
+- **`CD/CHDIR`** - Directory navigation with path validation
+
+**Phase 2 Commands (Extended File Operations):**
+- **`MD/MKDIR`** - Directory creation with nested path support
+- **`RD/RMDIR`** - Directory removal with safety checks
+- **`REN/RENAME`** - File and directory renaming
+- **`DEL/REMOVE`** - File deletion with wildcard support
+- **`PATH`** - Environment PATH variable management (GET/SET)
+- **`MOVE`** - File/directory moving (placeholder - not yet implemented)
+
+**Shell and System Commands:**
- **`ECHO`** (with ON/OFF variants) - Text output and echo state control
-- **`CLS`** - Clear screen with ANSI escape sequences
+- **`CLS`** - Clear screen with ANSI escape sequences
- **`EXIT`** - Exit the shell
- **`VER`** - Version information display
- **`DATE`** - Current system date with proper calendar calculations
- **`TIME`** - Current system time display
-- **`DIR`** - Directory listing with file sizes and counts
-- **`TYPE`** - Display file contents with binary character filtering
- **`SORT`** - Alphabetical line sorting with input redirection support
#### 🔧 **External Command Support**
@@ -92,6 +114,36 @@ The application uses a type-safe command architecture with Zig unions and enums:
- **ANSI Terminal Support**: Cross-platform terminal manipulation
- **Path Handling**: DOS-style path formatting on all platforms
+### Project Structure
+
+```
+src/
+├── cmd/ # Modular command implementations
+│ ├── lib/
+│ │ └── types.zig # Shared command types and interfaces
+│ ├── chdir.zig # CD/CHDIR command
+│ ├── cls.zig # CLS command
+│ ├── copy.zig # COPY command
+│ ├── date.zig # DATE command
+│ ├── dir.zig # DIR command
+│ ├── echo.zig # ECHO command variants
+│ ├── mkdir.zig # MD/MKDIR command
+│ ├── move.zig # MOVE command (placeholder)
+│ ├── path.zig # PATH command (GET/SET)
+│ ├── remove.zig # DEL/REMOVE command
+│ ├── rename.zig # REN/RENAME command
+│ ├── rmdir.zig # RD/RMDIR command
+│ ├── sort.zig # SORT command
+│ ├── time.zig # TIME command
+│ └── type.zig # TYPE command
+├── cmd.zig # Command type definitions and imports
+├── eval.zig # Command execution engine
+├── parser.zig # DOS command line parser
+├── paths.zig # DOS path formatting utilities
+├── syntax.zig # Command syntax structures
+└── main.zig # Application entry point and REPL
+```
+
### Dependencies
**Zero External Dependencies** - The Zig implementation uses only the standard library: