| 69 | } |
| 70 | |
| 71 | static void write_help(std::ostringstream & ss, const md_file & md) { |
| 72 | common_params params; |
| 73 | auto ctx_arg = common_params_parser_init(params, md.ex); |
| 74 | |
| 75 | std::vector<common_arg *> common_options; |
| 76 | std::vector<common_arg *> sparam_options; |
| 77 | std::vector<common_arg *> specific_options; |
| 78 | for (auto & opt : ctx_arg.options) { |
| 79 | // in case multiple LLAMA_EXAMPLE_* are set, we prioritize the LLAMA_EXAMPLE_* matching current example |
| 80 | if (opt.is_sparam) { |
| 81 | sparam_options.push_back(&opt); |
| 82 | } else if (opt.in_example(ctx_arg.ex)) { |
| 83 | specific_options.push_back(&opt); |
| 84 | } else { |
| 85 | common_options.push_back(&opt); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | ss << HELP_START_MARKER << "\n\n"; |
| 90 | |
| 91 | ss << NOTE_MESSAGE << "\n\n"; |
| 92 | |
| 93 | ss << "### Common params\n\n"; |
| 94 | write_table(ss, common_options); |
| 95 | ss << "\n\n### Sampling params\n\n"; |
| 96 | write_table(ss, sparam_options); |
| 97 | ss << "\n\n### " << md.specific_section_header << "\n\n"; |
| 98 | write_table(ss, specific_options); |
| 99 | |
| 100 | ss << "\n" << HELP_END_MARKER; |
| 101 | } |
| 102 | |
| 103 | int main(int, char **) { |
| 104 | std::setlocale(LC_NUMERIC, "C"); |
no test coverage detected