| 105 | } |
| 106 | |
| 107 | static bool parse_options(int argc, char ** argv, debug_options & opts) { |
| 108 | if (argc < 2) { |
| 109 | print_usage(argv[0]); |
| 110 | return false; |
| 111 | } |
| 112 | |
| 113 | opts.template_path = argv[1]; |
| 114 | |
| 115 | for (int i = 2; i < argc; ++i) { |
| 116 | std::string arg = argv[i]; |
| 117 | |
| 118 | if (arg == "--force-tool-call") { |
| 119 | opts.force_tool_call = true; |
| 120 | } else if (arg == "--debug-jinja") { |
| 121 | opts.debug_jinja = true; |
| 122 | } else if (arg == "--no-tools") { |
| 123 | opts.with_tools = false; |
| 124 | } else if (arg.rfind("--generation-prompt=", 0) == 0) { |
| 125 | opts.generation_prompt = parse_bool_option(arg.substr(20)); |
| 126 | } else if (arg.rfind("--enable-reasoning=", 0) == 0) { |
| 127 | opts.enable_reasoning = parse_bool_option(arg.substr(19)); |
| 128 | } else if (arg.rfind("--output=", 0) == 0) { |
| 129 | std::string mode = arg.substr(9); |
| 130 | if (mode == "analysis") { |
| 131 | opts.mode = output_mode::ANALYSIS; |
| 132 | } else if (mode == "template") { |
| 133 | opts.mode = output_mode::TEMPLATE; |
| 134 | } else if (mode == "both") { |
| 135 | opts.mode = output_mode::BOTH; |
| 136 | } else { |
| 137 | LOG_ERR("Unknown output mode: %s\n", mode.c_str()); |
| 138 | return false; |
| 139 | } |
| 140 | } else if (arg.rfind("--input-message=", 0) == 0) { |
| 141 | std::string type = arg.substr(16); |
| 142 | if (type == "content_only") { |
| 143 | opts.input_message = input_message_type::CONTENT_ONLY; |
| 144 | } else if (type == "reasoning_content") { |
| 145 | opts.input_message = input_message_type::REASONING_CONTENT; |
| 146 | } else if (type == "tool_call_only") { |
| 147 | opts.input_message = input_message_type::TOOL_CALL_ONLY; |
| 148 | } else if (type == "content_tool_call") { |
| 149 | opts.input_message = input_message_type::CONTENT_TOOL_CALL; |
| 150 | } else if (type == "reasoning_tool_call") { |
| 151 | opts.input_message = input_message_type::REASONING_TOOL_CALL; |
| 152 | } else if (type == "content_fake_tool_call") { |
| 153 | opts.input_message = input_message_type::CONTENT_FAKE_TOOL_CALL; |
| 154 | } else if (type == "all") { |
| 155 | opts.input_message = input_message_type::ALL; |
| 156 | } else { |
| 157 | LOG_ERR("Unknown input message type: %s\n", type.c_str()); |
| 158 | return false; |
| 159 | } |
| 160 | } else { |
| 161 | LOG_ERR("Unknown option: %s\n", arg.c_str()); |
| 162 | print_usage(argv[0]); |
| 163 | return false; |
| 164 | } |
no test coverage detected