| 3161 | // ************************* main function **************************************************** |
| 3162 | |
| 3163 | int main(int argc, char** argv) |
| 3164 | { |
| 3165 | // create objects |
| 3166 | ASFormatter formatter; |
| 3167 | g_console = new ASConsole(formatter); |
| 3168 | |
| 3169 | // process command line and options file |
| 3170 | // build the vectors fileNameVector, optionsVector, and fileOptionsVector |
| 3171 | vector<string> argvOptions; |
| 3172 | argvOptions = g_console->getArgvOptions(argc, argv); |
| 3173 | g_console->processOptions(argvOptions); |
| 3174 | |
| 3175 | // if no files have been given, use cin for input and cout for output |
| 3176 | if (g_console->fileNameVectorIsEmpty()) |
| 3177 | { |
| 3178 | g_console->formatCinToCout(); |
| 3179 | return EXIT_SUCCESS; |
| 3180 | } |
| 3181 | |
| 3182 | // process entries in the fileNameVector |
| 3183 | g_console->processFiles(); |
| 3184 | |
| 3185 | delete g_console; |
| 3186 | return EXIT_SUCCESS; |
| 3187 | } |
| 3188 | |
| 3189 | #endif // ASTYLE_LIB |
nothing calls this directly
no test coverage detected