Repository navigation
refactor(cmd): restructure command modules and update documentation - #1
Merged
Merged
Conversation
- Enable default testing functionality - Remove MSVC exception handling configuration - Adjust source file path structure - Add precompiled header support - Rename test directory from 'test' to 'tests' refactor(tests): Implement custom test logic and remove catch2 dependency - Implemented custom test logic - Removed dependency on catch2 for testing framework feat(main): Create main entry point and implement command dispatching - Create program main entry at src/Main/main.cpp - Implement command-line argument parsing, wildcard expansion, command dispatching functionality - Add help information display feat(utils): Add wildcard processing module - Create src/Main/wildcard_handler.cppm module - Implement wildcard expansion functionality for command-line arguments fix(cat): Replace standard output functions with safe print functions - Replace printf/fprintf/wprintf functions in cat command with safePrint family functions - Ensure correct output in both console and pipe modes refactor(cp): Update cp command implementation and fix error output - Update cp command option definitions and error message output methods - Use safePrint function family to replace traditional fprintf/wprintf functions - Improve error handling and user interaction docs(cp): Update cp command documentation comment format - Standardize contributor comment format - Optimize option description line break layout - Improve code readability
- Implemented complete echo command with support for --upper and --repeat options - Extended CommandMeta system to support different option types (bool, int, string) - Added blank line formatting to option documentation for various command modules - Introduced CommandContext struct for unified command parameter handling - Refactored command metadata registration mechanism to support runtime type erasure
- Introduce modern way to this project - The extra code would be adjust later(Next commit)
This commit refactors all command modules to adopt the new pipeline architecture. The changes include: ## Command Module Restructuring - Unified all command modules to follow the `cmd:<command>` naming convention - Replaced legacy option parsing with the new type-safe `CommandContext` system - Implemented pipeline component separation for validation and processing logic - Removed deprecated `auto_flags.h` and migrated to the new option handling system ## Build System Updates - Raised CMake minimum version requirement to 3.30.0 - Updated module dependencies and compilation targets - Enhanced build configuration for better module isolation ## Documentation Improvements - Added comprehensive management command documentation (`activate`, `deactivate`, `status`, `list`, `help`) - Updated architecture design documentation to reflect the pipeline approach - Rewrote option handling guide for the new type-safe system - Improved scaffold and DSL documentation for command creation - Synchronized content between English and Chinese documentation versions ## Key Architectural Changes 1. **Pipeline Pattern**: Each command now follows a clear pipeline structure with separate components for input validation, processing, and output generation 2. **Type Safety**: The new `CommandContext` provides compile-time type checking for option access 3. **Module Consistency**: All commands now share a consistent module structure and interface 4. **Improved Error Handling**: Better separation of validation errors from processing logic ## Breaking Changes - The `auto_flags.h` header is no longer available - migrate to the new option system - Command module imports must now use the `cmd:` prefix (e.g., `import cmd:ls`) - Minimum CMake version requirement is now 3.30.0 The refactor improves maintainability, provides better type safety, and establishes a clear architectural pattern for future command development.
caomengxuan666
added a commit
that referenced
this pull request
Mar 24, 2026
refactor(cmd): restructure command modules and update documentation
caomengxuan666
added a commit
that referenced
this pull request
Oct 31, 2026
Oracle: sed-4.9 sed/compile.c.
- q/Q with two addresses are a compile error in GNU (compile.c:1155-
1158, ONE_ADDR); they were silently accepted and run.
- Address 0 is valid only as 0,/RE/ or alone on the r command
(compile.c:1020-1027, INVALID_LINE_0); 0,2 and bare 0 were silently
accepted as a never-matching line address. Both checks also apply
to brace-group address pairs.
- The v command was missing entirely ('unsupported script command');
GNU treats it as a version gate (compile.c:1064-1076): the argument
(default 4.0) is strverscmp-compared against PACKAGE_VERSION 4.9 and
a newer request is a compile error ('expected newer version of
sed'); otherwise a no-op. Rejected under --posix like GNU.
Golden cases: corpus/sed/01..05 (error-text cases recorded as
KNOWN_DIFF with whitelist explanations: GNU prefixes script errors
with '-e expression #1, char N:', winuxcmd prints 'sed: <message>').
Refs #1462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit refactors all command modules to adopt the new pipeline architecture. The changes include:
Command Module Restructuring
cmd:<command>naming conventionCommandContextsystemauto_flags.hand migrated to the new option handling systemBuild System Updates
Documentation Improvements
activate,deactivate,status,list,help)Key Architectural Changes
CommandContextprovides compile-time type checking for option accessBreaking Changes
auto_flags.hheader is no longer available - migrate to the new option systemcmd:prefix (e.g.,import cmd:ls)The refactor improves maintainability, provides better type safety, and establishes a clear architectural pattern for future command development.