boostorg / boostorg/program_options
problem with different quotes
- Dominant language
- C++
- Stars
- 136
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
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)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the mixed single- and double-quote command-line example from the issue and locate the program_options command-line splitting entry point. Compare the resulting argument vector with the expected three-argument result, using the linked centreon-collect implementation as a reference; done means the example parses as specified without breaking existing quoting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100