poaflocParser Of Arguments For Lines Of Commands |
git clone git://git.dimitrijedobrota.com/poafloc.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING | |
commit | 7e8e8f3d66d11bffcfd7c4d99ac84b91fa86cef1 |
parent | f35303ec28b50839c56b8aac953e95b18379b610 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Wed, 12 Jun 2024 16:20:41 +0200 |
Fix sort issue where no long options are available
Diffstat:M | src/help.cpp | | | ++-- |
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/help.cpp b/src/help.cpp
@@ -26,8 +26,8 @@ bool Parser::help_entry_t::operator<(const help_entry_t &rhs) const {
: '0';
if (l1 != l2) return l1 < l2;
return std::strcmp(opt_long.front(), rhs.opt_long.front()) < 0;
if (!opt_long.empty() || !rhs.opt_long.empty()) return !opt_long.empty();
return std::strcmp(opt_long.front(), rhs.opt_long.front()) < 0;
}
void Parser::print_other_usages(FILE *stream) const {