Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TB_OPTION_MODE_KEY_VAL = 3 选项处理有错误 #185

Open
huye opened this issue May 8, 2022 · 3 comments
Open

TB_OPTION_MODE_KEY_VAL = 3 选项处理有错误 #185

huye opened this issue May 8, 2022 · 3 comments

Comments

@huye
Copy link

huye commented May 8, 2022

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将绝对不会有任何反馈。

描述问题

看源码注释是:TB_OPTION_MODE_KEY_VAL = 3 //!< --key=value or --key value or -k=value or -k value
但经过我测试只有 --key=value 和 -k=value 才行,另外两个不行!

我代码中的选项定义是这样的:
c {'c', "config", TB_OPTION_MODE_KEY_VAL, TB_OPTION_TYPE_CSTR, "配置文件路径,支持 json/xml 等格式"},

期待的结果

-c=xxx 正常, -c xxx 报错

错误信息

[tbox]: [option]: [error]: aiden: no option value '--c=' at tb_option_done(): 465, src/tbox/utils/option.c

相关环境

xmake v2.6.4+dev.35fa885

其他信息

xmake 中的依赖:

add_requires("tbox master", {
configs = {database = true, object = true},
debug = is_mode("debug")
})

@waruqi
Copy link
Member

waruqi commented May 8, 2022

暂不支持,目前仅支持 --key=value 和 -k=value

@huye
Copy link
Author

huye commented May 9, 2022

希望还是能支持一下,还有可选值选项类型,也希望能支持一下。

另外,如果能像 git log 这样的再支持一下子命令就更好了。当然 现在可以通过先自己处理子命令,再在各个子命令上分别解析参数。

@huye
Copy link
Author

huye commented May 9, 2022

还有 TB_OPTION_MODE_MORE 这个参数有 64 个长度限制吗,我看你示例代码里都只输出了64个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants