新增 argparse 库的基础框架,包含以下组件: - 创建了 argparse 库的 cbuild.toml 配置文件,定义包信息和依赖关系 - 实现了核心的参数解析功能,包括 optparse.h 和 optparse.c - 定义了参数解析相关的数据结构和枚举类型 - 实现了完整的命令行选项解析逻辑,支持长短选项、参数绑定等功能 - 添加了全面的单元测试,覆盖各种使用场景和边界情况 - 包含对短选项连写、长选项等号形式、选项终止符等特性的支持
32 lines
604 B
C
32 lines
604 B
C
#ifndef __SCC_ARGPARSE_H__
|
|
#define __SCC_ARGPARSE_H__
|
|
|
|
#include "optparse.h"
|
|
|
|
typedef enum {
|
|
SCC_ARGPARSE_ERROR_NONE,
|
|
} scc_argparse_error_t;
|
|
|
|
typedef struct {
|
|
} scc_argparse_cmd_t;
|
|
|
|
typedef struct {
|
|
} scc_argparse_arg_t;
|
|
|
|
typedef struct {
|
|
const char *name;
|
|
const char *description;
|
|
const char *epilog;
|
|
const char *usage;
|
|
const char *help;
|
|
scc_optparse_t optparse;
|
|
int usage_margin;
|
|
int usage_max_width;
|
|
int help_vertical_space;
|
|
int help_usage_margin;
|
|
int help_description_margin;
|
|
int help_max_width;
|
|
} scc_argparse_t;
|
|
|
|
#endif /* __SCC_ARGPARSE_H__ */
|