Problems with displaying long option description with cyrillic characters
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the options_description help output and the add_options call shown in the reproducer, then run the example with the long Cyrillic description. Trace how the streamed help text wraps the option and check that the output ends without replacement symbols when the column width is unchanged. The workaround of increasing the column width provides a comparison case.
Written by the indexing model from the issue text.
Description
I'm having some weird issues with displaying long option description that contains cyrillic characters:
[program_options]$ ./example --help
Allowed options:
-h [ --help ] print usage message
-f [ --enforcewrite ] enforcewrite Всегда перезаписывать
файлы в директории с
преобразованной
политикой безопасност▒
▒
Note that weird symbols at the description end.
Here's the code to reproduce it:
#include <boost/program_options.hpp>
using namespace boost::program_options;
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
string s;
options_description desc("Allowed options");
desc.add_options()
("help,h", "print usage message")
("enforcewrite,f", value(&s)->value_name("enforcewrite"),
"Всегда перезаписывать файлы в директории с преобразованной политикой безопасности");
variables_map vm;
store(parse_command_line(argc, argv, desc), vm);
if (vm.count("help")) {
cout << desc << "\n";
return 0;
}
}
Appearance of such symbols seems to depend somehow on the length of the text string associated with the option (including option name, default value and it's description). In my case I worked around the problem by increasing the column width.
program option version is: 1.62.0
OS: CentOS 7.1
- Dominant language
- C++
- Stars
- 136
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/program_options
-
Provide C++20 module Open
Difficulty 5/5 Over a week Newbie friendliness 45/100
boostorg/program_options#160 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
boostorg/program_options#159 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
boostorg/program_options#147 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
boostorg/program_options#146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
boostorg/program_options#144 ·
All issues in boostorg/program_options
Similar issues
-
ai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ydb-platform/ydb#53869 · 3 comments ·
-
bug cert blocker needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31035 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vllm-project/vllm-ascend#17329 ·