boostorg / boostorg/program_options

The parsing error of the multitoken argument with negative numbers

未关闭
#33 6 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
136
派生
117
PR 合并指标
30 天内没有已合并 PR

描述

The parsing error of the multitoken argument with negative numbers occurs while setting negative numbers after the first number.

For example, if we set an option
```cpp
("point,p", po::value>(&options.point)->multitoken(), "The point")
```
and enter in the command line the following values
```
prog -p -1 2 3
```
It works correctly.
However, if we enter the values given bellow
```
prog -p -1 -2 3
```
the parsing error occurs
```
unrecognised option '-2'
```

This error exists in Boost 1.65.1 as well.

贡献指南

这个仓库没有索引到贡献指南

调研方向

使用所示的多 token 选项和两个命令行示例重现该问题,然后跟踪将在第一个 token 之后对负值进行分类的命令行选项解析路径。完成的标准是接受 `-p -1 -2 3` 调用并生成与 `-p -1 2 3` 相同的向量,同时为报告的回归问题提供覆盖。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
40/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。