Commit aaa5e790b6b5b4c9de0b1ca3346ed0c2e55e4e03
1 parent
43ce03fd
Rename variable, add to example
Showing
2 changed files
with
5 additions
and
2 deletions
include/cxxopts.hpp
| @@ -1636,7 +1636,7 @@ namespace cxxopts | @@ -1636,7 +1636,7 @@ namespace cxxopts | ||
| 1636 | const HelpOptionDetails& o, | 1636 | const HelpOptionDetails& o, |
| 1637 | size_t start, | 1637 | size_t start, |
| 1638 | size_t allowed, | 1638 | size_t allowed, |
| 1639 | - bool m_tab_expansion | 1639 | + bool tab_expansion |
| 1640 | ) | 1640 | ) |
| 1641 | { | 1641 | { |
| 1642 | auto desc = o.desc; | 1642 | auto desc = o.desc; |
| @@ -1655,7 +1655,7 @@ namespace cxxopts | @@ -1655,7 +1655,7 @@ namespace cxxopts | ||
| 1655 | 1655 | ||
| 1656 | String result; | 1656 | String result; |
| 1657 | 1657 | ||
| 1658 | - if (m_tab_expansion) | 1658 | + if (tab_expansion) |
| 1659 | { | 1659 | { |
| 1660 | String desc2; | 1660 | String desc2; |
| 1661 | auto size = size_t{ 0 }; | 1661 | auto size = size_t{ 0 }; |
src/example.cpp
| @@ -39,6 +39,8 @@ parse(int argc, const char* argv[]) | @@ -39,6 +39,8 @@ parse(int argc, const char* argv[]) | ||
| 39 | bool apple = false; | 39 | bool apple = false; |
| 40 | 40 | ||
| 41 | options | 41 | options |
| 42 | + .set_width(70) | ||
| 43 | + .set_tab_expansion() | ||
| 42 | .allow_unrecognised_options() | 44 | .allow_unrecognised_options() |
| 43 | .add_options() | 45 | .add_options() |
| 44 | ("a,apple", "an apple", cxxopts::value<bool>(apple)) | 46 | ("a,apple", "an apple", cxxopts::value<bool>(apple)) |
| @@ -56,6 +58,7 @@ parse(int argc, const char* argv[]) | @@ -56,6 +58,7 @@ parse(int argc, const char* argv[]) | ||
| 56 | ("long-description", | 58 | ("long-description", |
| 57 | "thisisareallylongwordthattakesupthewholelineandcannotbebrokenataspace") | 59 | "thisisareallylongwordthattakesupthewholelineandcannotbebrokenataspace") |
| 58 | ("help", "Print help") | 60 | ("help", "Print help") |
| 61 | + ("tab-expansion", "Tab\texpansion") | ||
| 59 | ("int", "An integer", cxxopts::value<int>(), "N") | 62 | ("int", "An integer", cxxopts::value<int>(), "N") |
| 60 | ("float", "A floating point number", cxxopts::value<float>()) | 63 | ("float", "A floating point number", cxxopts::value<float>()) |
| 61 | ("vector", "A list of doubles", cxxopts::value<std::vector<double>>()) | 64 | ("vector", "A list of doubles", cxxopts::value<std::vector<double>>()) |