diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2026-02-10 19:38:36 +0100 |
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2026-02-25 19:02:50 +0100 |
| commit | 1af138308d01f96dd979f0137394dcbd5971d5e1 (patch) | |
| tree | 0c04c31a712d16ec834402b48729aa8c1d472b12 /src/argparser.h | |
| parent | 5a3e0931e0e4ccd252c527b512ec1634d57489d8 (diff) | |
WIP: installinstall
Diffstat (limited to 'src/argparser.h')
| -rw-r--r-- | src/argparser.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/argparser.h b/src/argparser.h index c5337e0..8f1ef39 100644 --- a/src/argparser.h +++ b/src/argparser.h @@ -237,6 +237,11 @@ public: options.emplace_back(Opt<noarg>{shortopt, longopt, cb, help}); } + void add(const std::string& caption) + { + options.emplace_back(Opt<noarg>{{}, {}, {}, caption}); + } + void set_pos_cb(std::function<int(std::string_view)> cb) { pos_cb = cb; @@ -270,6 +275,11 @@ public: using T = std::decay_t<decltype(opt)>; if constexpr (std::is_same_v<T, Opt<noarg>>) { + if(opt.longopt.empty()) + { + std::cout << "\n" << opt.help << ":\n"; + return; + } } else if constexpr (std::is_same_v<T, Opt<int>>) { |
