Description / 功能描述
English:
Implement stream redirection functionality from MobileSuit .NET v4.5+ to allow users to redirect command input/output to files, enabling better integration with shell scripts and automation workflows.
中文:
实现 MobileSuit .NET v4.5+ 的流重定向功能,允许用户将命令输入/输出重定向到文件,从而更好地与shell脚本和自动化工作流集成。
Features / 功能特性
English:
Output redirection: command args > output.txt (overwrite)
Append redirection: command args >> log.txt (append)
Input redirection: command < input.txt (read from file)
Support for absolute and relative file paths
Proper file handle management and cleanup
UTF-8 encoding by default
中文:
输出重定向: command args > output.txt (覆盖)
追加重定向: command args >> log.txt (追加)
输入重定向: command < input.txt (从文件读取)
支持绝对路径和相对路径
正确的文件句柄管理和清理
默认使用UTF-8编码
Tech Stack / 技术栈
Extend ParsingService to detect redirect operators / 扩展 ParsingService 检测重定向操作符
Create FileIOHub wrapping file streams / 创建包装文件流的 FileIOHub
Integration with SuitContext for IOHub swapping / 与 SuitContext 集成以交换IOHub
Difficulty & Time / 难度与时间
Difficulty / 难度: 🟡 Medium / 中等
Estimated Time / 预估时间: 3-5 days / 3-5天
Requirements / 要求
English:
MUST follow MobileSuit .NET API (see .claude/MobileSuitFeatures.md Feature 对SuitContext部分进行了单元测试 #12 )
MUST handle file permission errors gracefully with clear error messages
MUST properly close file handles to prevent resource leaks
MUST support UTF-8 encoding with proper BOM handling
PR MUST include:
Unit tests for all redirection types
Tests for error scenarios (permission denied, file not found, etc.)
Integration tests with real files
Documentation with examples
中文:
必须 遵循MobileSuit .NET API(参见 .claude/MobileSuitFeatures.md 功能 对SuitContext部分进行了单元测试 #12 )
必须 优雅地处理文件权限错误,并提供清晰的错误消息
必须 正确关闭文件句柄以防止资源泄漏
必须 支持UTF-8编码,正确处理BOM
PR 必须 包含:
所有重定向类型的单元测试
错误场景测试(权限拒绝、文件未找到等)
真实文件的集成测试
带示例的文档
Acceptance Criteria / 验收标准
Reference / 参考
See .claude/MobileSuitFeatures.md Feature #12 for detailed specification.
详细规格请参见 .claude/MobileSuitFeatures.md 功能 #12 。
Before Starting / 开始之前
Please comment on this issue to let us know you're working on it!
请在此issue下评论,让我们知道你正在处理!
Description / 功能描述
English:
Implement stream redirection functionality from MobileSuit .NET v4.5+ to allow users to redirect command input/output to files, enabling better integration with shell scripts and automation workflows.
中文:
实现 MobileSuit .NET v4.5+ 的流重定向功能,允许用户将命令输入/输出重定向到文件,从而更好地与shell脚本和自动化工作流集成。
Features / 功能特性
English:
command args > output.txt(overwrite)command args >> log.txt(append)command < input.txt(read from file)中文:
command args > output.txt(覆盖)command args >> log.txt(追加)command < input.txt(从文件读取)Tech Stack / 技术栈
ParsingServiceto detect redirect operators / 扩展ParsingService检测重定向操作符FileIOHubwrapping file streams / 创建包装文件流的FileIOHubSuitContextfor IOHub swapping / 与SuitContext集成以交换IOHubDifficulty & Time / 难度与时间
Difficulty / 难度: 🟡 Medium / 中等
Estimated Time / 预估时间: 3-5 days / 3-5天
Requirements / 要求
English:
.claude/MobileSuitFeatures.mdFeature 对SuitContext部分进行了单元测试 #12)中文:
.claude/MobileSuitFeatures.md功能 对SuitContext部分进行了单元测试 #12)Acceptance Criteria / 验收标准
>,>>,<operators inParsingService/ 在ParsingService中解析操作符>) / 实现输出重定向>>) / 实现追加重定向<) / 实现输入重定向>operator / 为>操作符创建/覆盖文件>>operator / 为>>操作符追加到现有文件<operator / 为<操作符逐行读取输入Reference / 参考
See
.claude/MobileSuitFeatures.mdFeature #12 for detailed specification.详细规格请参见
.claude/MobileSuitFeatures.md功能 #12。Before Starting / 开始之前
Please comment on this issue to let us know you're working on it!
请在此issue下评论,让我们知道你正在处理!