@@ -151,17 +151,17 @@ bool ParseKeyName(KeyNameCode const* valid, size_t validCount, char* name, char
151151 }
152152 }
153153
154- int col = PrintError (" error: %s '%s'.\n Valid options (case insensitive):" , errorMessage, name);
154+ int col = PrintErrorNoNewLine (" error: %s '%s'.\n Valid options (case insensitive):" , errorMessage, name);
155155
156156 size_t consoleWidth = GetConsoleWidth ();
157157 for (size_t i = 0 ; i < validCount; ++i) {
158158 auto len = strlen (valid[i].mName );
159159 if (col + len + 1 > consoleWidth) {
160- col = PrintError (" \n " ) - 1 ;
160+ col = PrintErrorNoNewLine (" \n " ) - 1 ;
161161 }
162- col += PrintError (" %s" , valid[i].mName );
162+ col += PrintErrorNoNewLine (" %s" , valid[i].mName );
163163 }
164- PrintError ( " \n " );
164+ fprintf (stderr, " \n " );
165165
166166 return false ;
167167}
@@ -193,11 +193,11 @@ bool AssignHotkey(char* key, CommandLineArgs* args)
193193void SetCaptureAll (CommandLineArgs* args)
194194{
195195 if (!args->mTargetProcessNames .empty ()) {
196- PrintWarning (" warning: -captureall elides all previous -process_name arguments.\n " );
196+ PrintWarning (" warning: -captureall elides all previous -process_name arguments." );
197197 args->mTargetProcessNames .clear ();
198198 }
199199 if (args->mTargetPid != 0 ) {
200- PrintWarning (" warning: -captureall elides all previous -process_id arguments.\n " );
200+ PrintWarning (" warning: -captureall elides all previous -process_id arguments." );
201201 args->mTargetPid = 0 ;
202202 }
203203}
@@ -234,7 +234,7 @@ bool ParseValue(char** argv, int argc, int* i)
234234 *i += 1 ;
235235 return true ;
236236 }
237- PrintError (" error: %s expecting argument.\n " , argv[*i]);
237+ PrintError (" error: %s expecting argument." , argv[*i]);
238238 return false ;
239239}
240240
@@ -413,7 +413,7 @@ bool ParseCommandLine(int argc, char** argv)
413413
414414 // Provided argument wasn't recognized
415415 else if (!(ParseArg (argv[i], " ?" ) || ParseArg (argv[i], " h" ) || ParseArg (argv[i], " help" ))) {
416- PrintError (" error: unrecognized argument '%s'.\n " , argv[i]);
416+ PrintError (" error: unrecognized argument '%s'." , argv[i]);
417417 }
418418
419419 PrintHelp ();
@@ -422,32 +422,32 @@ bool ParseCommandLine(int argc, char** argv)
422422
423423 // Handle deprecated command line arguments
424424 if (DEPRECATED_simple) {
425- PrintWarning (" warning: -simple command line argument has been deprecated; using -no_track_display instead.\n " );
425+ PrintWarning (" warning: -simple command line argument has been deprecated; using -no_track_display instead." );
426426 args->mTrackDisplay = false ;
427427 }
428428 if (DEPRECATED_verbose) {
429- PrintWarning (" warning: -verbose command line argument has been deprecated; using -track_debug instead.\n " );
429+ PrintWarning (" warning: -verbose command line argument has been deprecated; using -track_debug instead." );
430430 args->mTrackDebug = true ;
431431 }
432432 if (DEPRECATED_wmr) {
433- PrintWarning (" warning: -include_mixed_reality command line argument has been deprecated; using -track_mixed_reality instead.\n " );
433+ PrintWarning (" warning: -include_mixed_reality command line argument has been deprecated; using -track_mixed_reality instead." );
434434 args->mTrackWMR = true ;
435435 }
436436 if (DEPRECATED_dontRestart) {
437- PrintWarning (" warning: -dont_restart_as_admin command line argument has been deprecated; it is now the default behaviour.\n " );
437+ PrintWarning (" warning: -dont_restart_as_admin command line argument has been deprecated; it is now the default behaviour." );
438438 }
439439
440440 // Ignore -no_track_display if required for other requested tracking
441441 if (args->mTrackDebug && !args->mTrackDisplay ) {
442- PrintWarning (" warning: -track_debug requires display tracking; ignoring -no_track_display.\n " );
442+ PrintWarning (" warning: -track_debug requires display tracking; ignoring -no_track_display." );
443443 args->mTrackDisplay = true ;
444444 }
445445 if (args->mTrackGPU && !args->mTrackDisplay ) {
446- PrintWarning (" warning: -track_gpu requires display tracking; ignoring -no_track_display.\n " );
446+ PrintWarning (" warning: -track_gpu requires display tracking; ignoring -no_track_display." );
447447 args->mTrackDisplay = true ;
448448 }
449449 if (args->mTrackGPUVideo && !args->mTrackDisplay ) {
450- PrintWarning (" warning: -track_gpu_video requires display tracking; ignoring -no_track_display.\n " );
450+ PrintWarning (" warning: -track_gpu_video requires display tracking; ignoring -no_track_display." );
451451 args->mTrackDisplay = true ;
452452 }
453453
@@ -459,7 +459,7 @@ bool ParseCommandLine(int argc, char** argv)
459459
460460 // -date_time is mutually exclusive to -qpc_time and -qpc_time_s
461461 if (args->mOutputDateTime && (args->mOutputQpcTime || args->mOutputQpcTimeInSeconds )) {
462- PrintError (" error: -date_time and -qpc_time or -qpc_time_s cannot be used at the same time.\n " );
462+ PrintError (" error: -date_time and -qpc_time or -qpc_time_s cannot be used at the same time." );
463463 PrintHelp ();
464464 return false ;
465465 }
@@ -469,13 +469,13 @@ bool ParseCommandLine(int argc, char** argv)
469469 if ((args->mHotkeyModifiers & MOD_CONTROL) != 0 && (
470470 args->mHotkeyVirtualKeyCode == 0x44 /* C*/ ||
471471 args->mHotkeyVirtualKeyCode == VK_SCROLL)) {
472- PrintError (" error: CTRL+C or CTRL+SCROLL cannot be used as a -hotkey, they are reserved for terminating the trace.\n " );
472+ PrintError (" error: CTRL+C or CTRL+SCROLL cannot be used as a -hotkey, they are reserved for terminating the trace." );
473473 PrintHelp ();
474474 return false ;
475475 }
476476
477477 if (args->mHotkeyModifiers == MOD_NOREPEAT && args->mHotkeyVirtualKeyCode == VK_F12) {
478- PrintError (" error: 'F12' cannot be used as a -hotkey, it is reserved for the debugger.\n " );
478+ PrintError (" error: 'F12' cannot be used as a -hotkey, it is reserved for the debugger." );
479479 PrintHelp ();
480480 return false ;
481481 }
@@ -485,24 +485,24 @@ bool ParseCommandLine(int argc, char** argv)
485485 // -output_file, or -output_stdout if they are also used.
486486 if (!args->mOutputCsvToFile ) {
487487 if (args->mOutputQpcTime ) {
488- PrintWarning (" warning: -qpc_time and -qpc_time_s are only relevant for CSV output; ignoring due to -no_csv.\n " );
488+ PrintWarning (" warning: -qpc_time and -qpc_time_s are only relevant for CSV output; ignoring due to -no_csv." );
489489 args->mOutputQpcTime = false ;
490490 args->mOutputQpcTimeInSeconds = false ;
491491 }
492492 if (args->mOutputDateTime ) {
493- PrintWarning (" warning: -date_time is only relevant for CSV output; ignoring due to -no_csv.\n " );
493+ PrintWarning (" warning: -date_time is only relevant for CSV output; ignoring due to -no_csv." );
494494 args->mOutputDateTime = false ;
495495 }
496496 if (args->mMultiCsv ) {
497- PrintWarning (" warning: -multi_csv and -no_csv arguments are not compatible; ignoring -multi_csv.\n " );
497+ PrintWarning (" warning: -multi_csv and -no_csv arguments are not compatible; ignoring -multi_csv." );
498498 args->mMultiCsv = false ;
499499 }
500500 if (args->mOutputCsvFileName != nullptr ) {
501- PrintWarning (" warning: -output_file and -no_csv arguments are not compatible; ignoring -output_file.\n " );
501+ PrintWarning (" warning: -output_file and -no_csv arguments are not compatible; ignoring -output_file." );
502502 args->mOutputCsvFileName = nullptr ;
503503 }
504504 if (args->mOutputCsvToStdout ) {
505- PrintWarning (" warning: -output_stdout and -no_csv arguments are not compatible; ignoring -output_stdout.\n " );
505+ PrintWarning (" warning: -output_stdout and -no_csv arguments are not compatible; ignoring -output_stdout." );
506506 args->mOutputCsvToStdout = false ;
507507 }
508508 }
@@ -517,18 +517,18 @@ bool ParseCommandLine(int argc, char** argv)
517517 args->mConsoleOutputType = ConsoleOutput::None;
518518
519519 if (args->mOutputCsvFileName != nullptr ) {
520- PrintError (" error: only one of -output_file or -output_stdout arguments can be used.\n " );
520+ PrintError (" error: only one of -output_file or -output_stdout arguments can be used." );
521521 PrintHelp ();
522522 return false ;
523523 }
524524
525525 if (args->mMultiCsv ) {
526- PrintWarning (" warning: -multi_csv and -output_stdout are not compatible; ignoring -multi_csv.\n " );
526+ PrintWarning (" warning: -multi_csv and -output_stdout are not compatible; ignoring -multi_csv." );
527527 args->mMultiCsv = false ;
528528 }
529529
530530 if (args->mTrackWMR ) {
531- PrintWarning (" warning: -track_mixed_reality and -output_stdout are not compatible; ignoring -track_mixed_reality.\n " );
531+ PrintWarning (" warning: -track_mixed_reality and -output_stdout are not compatible; ignoring -track_mixed_reality." );
532532 args->mTrackWMR = false ;
533533 }
534534 }
@@ -544,15 +544,15 @@ bool ParseCommandLine(int argc, char** argv)
544544 // Try to initialize the console, and warn if we're not going to be able to
545545 // do the advanced display as requested.
546546 if (args->mConsoleOutputType == ConsoleOutput::Full && !IsConsoleInitialized ()) {
547- PrintWarning (" warning: could not initialize console display; continuing with -no_top.\n " );
547+ PrintWarning (" warning: could not initialize console display; continuing with -no_top." );
548548 args->mConsoleOutputType = ConsoleOutput::Simple;
549549 }
550550
551551 // If -terminate_existing, warn about any normal arguments since we'll just
552552 // be stopping an existing session and then exiting.
553553 if (args->mTerminateExisting && argc != 2 ) {
554554 PrintWarning (" warning: -terminate_existing exits without capturing anything; ignoring all capture,\n "
555- " output, and recording arguments.\n " );
555+ " output, and recording arguments." );
556556 }
557557
558558 // Convert the provided process names into a canonical form used for comparison.
0 commit comments