| 163 | !*/ |
| 164 | |
| 165 | int main(int argc, char** argv) |
| 166 | { |
| 167 | if (argc == 1) |
| 168 | { |
| 169 | cout << "\nTry the -h option for more information.\n"; |
| 170 | return 0; |
| 171 | } |
| 172 | |
| 173 | string file; |
| 174 | try |
| 175 | { |
| 176 | command_line_parser parser; |
| 177 | parser.add_option("b","Pretty print in black and white. The default is to pretty print in color."); |
| 178 | parser.add_option("n","Number lines."); |
| 179 | parser.add_option("h","Displays this information."); |
| 180 | parser.add_option("index","Create an index."); |
| 181 | parser.add_option("v","Display version."); |
| 182 | parser.add_option("man","Display the manual."); |
| 183 | parser.add_option("f","Specifies a list of file extensions to process when using the -i option. The list elements should be separated by spaces. The default is \"cpp h c\".",1); |
| 184 | parser.add_option("i","Specifies an input directory.",1); |
| 185 | parser.add_option("I","Search this include directory after the source directory when linking quoted includes. Repeatable, in search order.",1); |
| 186 | parser.add_option("cat","Puts all the output into a single html file with the given name.",1); |
| 187 | parser.add_option("depth","Specifies how many directories deep to search when using the i option. The default value is 30.",1); |
| 188 | parser.add_option("o","This option causes all the output files to be created inside the given directory. If this option is not given then all output goes to the current working directory.",1); |
| 189 | parser.add_option("flatten","When this option is given it prevents the input directory structure from being replicated."); |
| 190 | parser.add_option("title","This option specifies a string which is prepended onto the title of the generated HTML",1); |
| 191 | parser.add_option("to-xml","Instead of generating HTML output, create a single output file called output.xml that contains " |
| 192 | "a simple XML database which lists all documented classes and functions."); |
| 193 | parser.add_option("t", "When creating XML output, replace tabs in comments with <arg> spaces.", 1); |
| 194 | |
| 195 | |
| 196 | parser.parse(argc,argv); |
| 197 | |
| 198 | |
| 199 | parser.check_incompatible_options("cat","o"); |
| 200 | parser.check_incompatible_options("cat","flatten"); |
| 201 | parser.check_incompatible_options("cat","index"); |
| 202 | parser.check_option_arg_type<unsigned long>("depth"); |
| 203 | parser.check_option_arg_range("t", 1, 100); |
| 204 | |
| 205 | parser.check_incompatible_options("to-xml", "b"); |
| 206 | parser.check_incompatible_options("to-xml", "n"); |
| 207 | parser.check_incompatible_options("to-xml", "index"); |
| 208 | parser.check_incompatible_options("to-xml", "cat"); |
| 209 | parser.check_incompatible_options("to-xml", "o"); |
| 210 | parser.check_incompatible_options("to-xml", "flatten"); |
| 211 | parser.check_incompatible_options("to-xml", "title"); |
| 212 | parser.check_incompatible_options("to-xml", "I"); |
| 213 | |
| 214 | const char* singles[] = {"b","n","h","index","v","man","f","cat","depth","o","flatten","title","to-xml", "t"}; |
| 215 | parser.check_one_time_options(singles); |
| 216 | |
| 217 | const char* i_sub_ops[] = {"f","depth","flatten"}; |
| 218 | parser.check_sub_options("i",i_sub_ops); |
| 219 | |
| 220 | const char* to_xml_sub_ops[] = {"t"}; |
| 221 | parser.check_sub_options("to-xml",to_xml_sub_ops); |
| 222 |
nothing calls this directly
no test coverage detected