* Diplays the help message and then exits with an error code. */
| 686 | * Diplays the help message and then exits with an error code. |
| 687 | */ |
| 688 | void help() { |
| 689 | fprintf(stderr, "Usage: thrift [options] file\n"); |
| 690 | fprintf(stderr, "Options:\n"); |
| 691 | fprintf(stderr, " -version Print the compiler version\n"); |
| 692 | fprintf(stderr, " -o dir Set the output directory for gen-* packages\n"); |
| 693 | fprintf(stderr, " (default: current directory)\n"); |
| 694 | fprintf(stderr, " -out dir Set the ouput location for generated files.\n"); |
| 695 | fprintf(stderr, " (no gen-* folder will be created)\n"); |
| 696 | fprintf(stderr, " -I dir Add a directory to the list of directories\n"); |
| 697 | fprintf(stderr, " searched for include directives\n"); |
| 698 | fprintf(stderr, " -nowarn Suppress all compiler warnings (BAD!)\n"); |
| 699 | fprintf(stderr, " -strict Strict compiler warnings on\n"); |
| 700 | fprintf(stderr, " -v[erbose] Verbose mode\n"); |
| 701 | fprintf(stderr, " -r[ecurse] Also generate included files\n"); |
| 702 | fprintf(stderr, " -debug Parse debug trace to stdout\n"); |
| 703 | fprintf(stderr, |
| 704 | " --allow-neg-keys Allow negative field keys (Used to " |
| 705 | "preserve protocol\n"); |
| 706 | fprintf(stderr, " compatibility with older .thrift files)\n"); |
| 707 | fprintf(stderr, " --allow-64bit-consts Do not print warnings about using 64-bit constants\n"); |
| 708 | fprintf(stderr, " --gen STR Generate code with a dynamically-registered generator.\n"); |
| 709 | fprintf(stderr, " STR has the form language[:key1=val1[,key2[,key3=val3]]].\n"); |
| 710 | fprintf(stderr, " Keys and values are options passed to the generator.\n"); |
| 711 | fprintf(stderr, " Many options will not require values.\n"); |
| 712 | fprintf(stderr, "\n"); |
| 713 | fprintf(stderr, "Options related to audit operation\n"); |
| 714 | fprintf(stderr, " --audit OldFile Old Thrift file to be audited with 'file'\n"); |
| 715 | fprintf(stderr, " -Iold dir Add a directory to the list of directories\n"); |
| 716 | fprintf(stderr, " searched for include directives for old thrift file\n"); |
| 717 | fprintf(stderr, " -Inew dir Add a directory to the list of directories\n"); |
| 718 | fprintf(stderr, " searched for include directives for new thrift file\n"); |
| 719 | fprintf(stderr, "\n"); |
| 720 | fprintf(stderr, "Available generators (and options):\n"); |
| 721 | |
| 722 | t_generator_registry::gen_map_t gen_map = t_generator_registry::get_generator_map(); |
| 723 | t_generator_registry::gen_map_t::iterator iter; |
| 724 | for (iter = gen_map.begin(); iter != gen_map.end(); ++iter) { |
| 725 | fprintf(stderr, |
| 726 | " %s (%s):\n", |
| 727 | iter->second->get_short_name().c_str(), |
| 728 | iter->second->get_long_name().c_str()); |
| 729 | fprintf(stderr, "%s", iter->second->get_documentation().c_str()); |
| 730 | } |
| 731 | exit(1); |
| 732 | } |
| 733 | |
| 734 | /** |
| 735 | * You know, when I started working on Thrift I really thought it wasn't going |
no test coverage detected