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