boostorg / boostorg/program_options

problem with different quotes

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

描述

boost 1.87
alma9

When you mix " and ' in a command line unix command line, unix parser and perhaps windows one doesn't take into account the first type of quote.
An example:
with this command line: /bin/sh -c '/bin/echo "ResourceFile AdminPager: " >> /tmp/notif_toto.txt'

It split in
std::vector of length 5, capacity 8 = {"/bin/sh", "-c", "/bin/echo ResourceFile", "AdminPager:", " >> /tmp/notif_toto.txt"}

It should split in:
std::vector of length 3, capacity 8 = {"/bin/sh", "-c", "/bin/echo "ResourceFile AdminPager:" >> /tmp/notif_toto.txt"}

An example of implementation: [centreon collect](https://github.com/centreon/centreon-collect/blob/4fc9ec16970fa0390aa2e185040ad47cfd0a852c/clib/src/misc/command_line.cc#L136)

贡献指南

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

调研方向

首先重现 issue 中单引号和双引号混用的命令行示例,并定位 program_options 的命令行拆分入口。以链接的 centreon-collect 实现为参考,将生成的参数向量与预期的三个参数结果进行比较;当示例能够按指定方式解析且不破坏现有的引号行为时,即视为完成。

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

评估

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

把新 issue 发到你的邮箱

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