diff options
author | hitsedesen <hitsedesen@yandex-team.com> | 2023-09-07 09:14:47 +0300 |
---|---|---|
committer | hitsedesen <hitsedesen@yandex-team.com> | 2023-09-07 10:21:52 +0300 |
commit | 3cd71626b58f2e1958655ea8969d6878ddba51df (patch) | |
tree | 86be15b1e67219f4e0439cbbaafce441d3e7747f /library/cpp/getopt/small/last_getopt_opts.cpp | |
parent | 8662052579e525caf2a824dac5f7589de99ef10c (diff) | |
download | ydb-3cd71626b58f2e1958655ea8969d6878ddba51df.tar.gz |
Add choices to getopt options
Diffstat (limited to 'library/cpp/getopt/small/last_getopt_opts.cpp')
-rw-r--r-- | library/cpp/getopt/small/last_getopt_opts.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/cpp/getopt/small/last_getopt_opts.cpp b/library/cpp/getopt/small/last_getopt_opts.cpp index 03c432849f..939d5d59d2 100644 --- a/library/cpp/getopt/small/last_getopt_opts.cpp +++ b/library/cpp/getopt/small/last_getopt_opts.cpp @@ -427,6 +427,14 @@ namespace NLastGetopt { os << Wrap(Wrap_, help, SPad + leftPadding + " ", &lastLineLength, &helpHasParagraphs); } + auto choicesHelp = opt->GetChoicesHelp(); + if (!choicesHelp.empty()) { + if (help) { + os << Endl << SPad << leftPadding << " "; + } + os << "(values: " << choicesHelp << ")"; + } + if (opt->HasDefaultValue()) { auto quotedDef = QuoteForHelp(opt->GetDefaultValue()); if (helpHasParagraphs) { |