boostorg / boostorg/program_options
The parsing error of the multitoken argument with negative numbers
- Lingua principale
- C++
- Stelle
- 136
- Fork
- 117
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Reproduce the issue with the shown multitoken option and both command-line examples, then trace the command-line option parsing path that classifies negative values after the first token. Done means the `-p -1 -2 3` invocation is accepted and produces the same vector as `-p -1 2 3`, with coverage for the reported regression.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 40/100