Skip to content

Commit

Permalink
Merge pull request #8 from mtygesen/fix-empty-default
Browse files Browse the repository at this point in the history
Fixed empty default options being printed
  • Loading branch information
stephenberry authored Mar 24, 2024
2 parents 3ddc1b5 + a1bda6d commit 65a1ac1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/argz/argz.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ namespace argz
else {
std::cout << (ids.id.size() == 1 ? "-" : "--") << ids.id;
}
std::cout << " " << h << ", default: " << detail::to_string(v) << '\n';

std::cout << " " << h;
detail::to_string(v).empty() ? std::cout << '\n' : std::cout << ", default: " << detail::to_string(v) << '\n';
}
std::cout << '\n';
}
Expand Down

0 comments on commit 65a1ac1

Please sign in to comment.