| 170 | } |
| 171 | |
| 172 | int main(int argc, char* argv[]) |
| 173 | try |
| 174 | { |
| 175 | using namespace fusion::debugviewpp; |
| 176 | |
| 177 | // install CTRL-C handler |
| 178 | SetConsoleCtrlHandler(ConsoleHandler, TRUE); |
| 179 | |
| 180 | Settings settings = {0}; |
| 181 | std::cout << "DebugViewConsole v" << VERSION_STR << std::endl; |
| 182 | settings.timestamp = false; |
| 183 | if (cmdOptionExists(argv, argv+argc, "-h") || cmdOptionExists(argv, argv+argc, "--help")) |
| 184 | { |
| 185 | std::cout << "options:\n"; |
| 186 | std::cout << " -h: this help message\n"; |
| 187 | std::cout << " -a: auto-newline (automatically adds newline to messages without a newline, most people want this on)\n"; |
| 188 | std::cout << " -f: flush (aggressively flush buffers, if unsure, do not use)\n"; |
| 189 | std::cout << " -v: verbose output\n"; |
| 190 | std::cout << " -d <file>: write to .dblog file\n"; |
| 191 | std::cout << " -c enable console output\n"; |
| 192 | std::cout << "console output options: (do not effect the dblog file)\n"; |
| 193 | //std::cout << "-u: send a UDP test-message (used only for debugging)\n"; |
| 194 | std::cout << " -l: prefix line number\n"; |
| 195 | std::cout << " -s: prefix messages with system time\n"; |
| 196 | std::cout << " -q: prefix message with high-precision (<1us) offset (from QueryPerformanceCounter)\n"; |
| 197 | std::cout << " -t: tab-separated output\n"; |
| 198 | std::cout << " -p: add PID (process ID)\n"; |
| 199 | std::cout << " -n: add process name\n"; |
| 200 | exit(0); |
| 201 | } |
| 202 | |
| 203 | bool verbose = false; |
| 204 | if (cmdOptionExists(argv, argv + argc, "-v")) |
| 205 | { |
| 206 | if (verbose) std::cout << "-s: verbose output\n"; |
| 207 | verbose = true; |
| 208 | } |
| 209 | |
| 210 | if (cmdOptionExists(argv, argv + argc, "-l")) |
| 211 | { |
| 212 | if (verbose) |
| 213 | std::cout << "-l: prefix line number\n"; |
| 214 | settings.linenumber = true; |
| 215 | } |
| 216 | |
| 217 | if (cmdOptionExists(argv, argv + argc, "-s")) |
| 218 | { |
| 219 | if (verbose) |
| 220 | std::cout << "-s: including systemtime\n"; |
| 221 | settings.timestamp = true; |
| 222 | } |
| 223 | if (cmdOptionExists(argv, argv + argc, "-q")) |
| 224 | { |
| 225 | if (verbose) |
| 226 | std::cout << "-q: including relative high-precision offset\n"; |
| 227 | settings.performanceCounter = true; |
| 228 | } |
| 229 | if (cmdOptionExists(argv, argv + argc, "-t")) |
nothing calls this directly
no test coverage detected