| 184 | } |
| 185 | |
| 186 | int main(int argc, char* argv[]) |
| 187 | { |
| 188 | if (argc != 2) { |
| 189 | std::cerr << "Provide code file via command line." << std::endl; |
| 190 | return 1; |
| 191 | } |
| 192 | |
| 193 | const auto functions = fplus::sort_on(get_function_help_name, |
| 194 | parse_code_file(std::string(argv[1]))); |
| 195 | const auto broken = get_broken_function_helps(functions); |
| 196 | std::cout << "broken:" << std::endl; |
| 197 | if (fplus::is_not_empty(broken)) { |
| 198 | std::cout << fplus::show_cont_with_frame_and_newlines( |
| 199 | "\n-----\n", "[", "]", |
| 200 | get_broken_function_helps(functions), |
| 201 | 0) << std::endl; |
| 202 | return 1; |
| 203 | } |
| 204 | std::cout << "---" << std::endl; |
| 205 | |
| 206 | using fplus::transform; |
| 207 | std::cout << "duplicate help names:" << std::endl; |
| 208 | print_duplicates(transform(get_function_help_name, functions)); |
| 209 | // print_duplicates(transform(get_function_help_signature, functions)); |
| 210 | std::cout << "duplicate help documentations:" << std::endl; |
| 211 | print_duplicates(transform(get_function_help_documentation, functions)); |
| 212 | std::cout << "duplicate help declarations:" << std::endl; |
| 213 | print_duplicates(transform(get_function_help_declaration, functions)); |
| 214 | |
| 215 | auto output = functions_to_elm_code(functions); |
| 216 | std::string out_file = "frontend/src/Database.elm"; |
| 217 | if (fplus::write_text_file(out_file, output)()) { |
| 218 | std::cout << out_file << " written." << std::endl; |
| 219 | } else { |
| 220 | std::cerr << "Error: Unable to write " << out_file << std::endl; |
| 221 | } |
| 222 | } |
nothing calls this directly
no test coverage detected