feat(argparse): 新增命令行参数解析库

新增 argparse 库的基础框架,包含以下组件:

- 创建了 argparse 库的 cbuild.toml 配置文件,定义包信息和依赖关系
- 实现了核心的参数解析功能,包括 optparse.h 和 optparse.c
- 定义了参数解析相关的数据结构和枚举类型
- 实现了完整的命令行选项解析逻辑,支持长短选项、参数绑定等功能
- 添加了全面的单元测试,覆盖各种使用场景和边界情况
- 包含对短选项连写、长选项等号形式、选项终止符等特性的支持
This commit is contained in:
zzy
2026-02-03 12:35:45 +08:00
parent 2a90e165a5
commit d1b215861c
6 changed files with 1003 additions and 0 deletions

10
libs/argparse/cbuild.toml Normal file
View File

@@ -0,0 +1,10 @@
[package]
name = "argparse"
version = "0.1.0"
authors = []
description = ""
dependencies = [{ name = "scc_core", path = "../../runtime/scc_core" }]
# dependencies = []
# features = {}
# default_features = []