| 873 | |
| 874 | |
| 875 | std::string SingleCommand::gen_help(const std::string arg0) |
| 876 | { |
| 877 | std::stringstream r; |
| 878 | r << arg0 << ": " << command << " - " << description << std::endl; |
| 879 | r << std::endl; |
| 880 | |
| 881 | std::stringstream cmt_before; |
| 882 | for (const auto &c : comments) |
| 883 | { |
| 884 | cmt_before << c.GetComment(CommentPlacement::BEFORE_OPTS); |
| 885 | } |
| 886 | if (!cmt_before.str().empty()) |
| 887 | { |
| 888 | r << cmt_before.str() << std::endl; |
| 889 | } |
| 890 | |
| 891 | for (const auto &opt : options) |
| 892 | { |
| 893 | for (const auto &l : opt->gen_help_line()) |
| 894 | { |
| 895 | r << " " << l << std::endl; |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | std::stringstream cmt_after; |
| 900 | for (const auto &c : comments) |
| 901 | { |
| 902 | cmt_after << c.GetComment(CommentPlacement::AFTER_OPTS); |
| 903 | } |
| 904 | if (!cmt_after.str().empty()) |
| 905 | { |
| 906 | r << std::endl |
| 907 | << cmt_after.str(); |
| 908 | } |
| 909 | return r.str(); |
| 910 | } |
| 911 | |
| 912 | |
| 913 |
nothing calls this directly
no test coverage detected