@@ -520,13 +520,12 @@ namespace
520520
521521 void apply_docs_env (const Options &opt)
522522 {
523- if (!opt.docs .has_value ())
524- return ;
523+ const bool enabled = opt.docs .has_value () && *opt.docs ;
525524
526525#ifdef _WIN32
527- _putenv_s (" VIX_DOCS" , (*opt. docs ? " 1" : " 0" ) );
526+ _putenv_s (" VIX_DOCS" , enabled ? " 1" : " 0" );
528527#else
529- ::setenv (" VIX_DOCS" , (*opt.docs ? " 1" : " 0" ) , 1);
528+ ::setenv (" VIX_DOCS" , enabled ? " 1" : " 0" , 1 );
530529#endif
531530 }
532531
@@ -727,7 +726,8 @@ namespace
727726 replayConfig.replayable = true ;
728727
729728 std::string replayErr;
730- const bool replayEnabled = recorder.begin (replayConfig, replayErr);
729+ const bool replayEnabled =
730+ opt.replay && recorder.begin (replayConfig, replayErr);
731731
732732 replay::ReplayCapture replayCapture;
733733 if (replayEnabled)
@@ -1712,6 +1712,7 @@ namespace vix::commands::RunCommand
17121712 out << " -j, --jobs <n> Parallel build jobs\n " ;
17131713 out << " --clear <auto|always|never> Clear terminal before runtime output (default: auto)\n " ;
17141714 out << " --no-clear Alias for --clear=never\n\n " ;
1715+ out << " --replay Record this run under .vix/runs/ for vix replay\n " ;
17151716
17161717 out << " Runtime options (argv / env):\n " ;
17171718 out << " --cwd <path> Run the program with this working directory\n " ;
@@ -1736,9 +1737,9 @@ namespace vix::commands::RunCommand
17361737 out << " --local-cache Use local .vix-scripts instead of global cache\n " ;
17371738
17381739 out << " Documentation:\n " ;
1739- out << " --docs Enable auto docs (sets VIX_DOCS=1)\n " ;
1740- out << " --no-docs Disable auto docs (sets VIX_DOCS=0)\n " ;
1741- out << " --docs=<0|1|true|false> Explicitly control docs generation \n\n " ;
1740+ out << " --docs Enable OpenAPI/ docs for this run (sets VIX_DOCS=1)\n " ;
1741+ out << " --no-docs Keep OpenAPI/ docs disabled (sets VIX_DOCS=0)\n " ;
1742+ out << " --docs=<0|1|true|false> Explicitly control OpenAPI/ docs\n\n " ;
17421743
17431744 out << " Logging:\n " ;
17441745 out << " --log-level <level> trace | debug | info | warn | error | critical | off\n " ;
@@ -1776,6 +1777,8 @@ namespace vix::commands::RunCommand
17761777 out << " vix run main.cpp --with-mysql\n " ;
17771778 out << " vix run main.cpp -- -O2 -DNDEBUG --run hello 123\n " ;
17781779 out << " vix run main.cpp -- -lssl -lcrypto\n\n " ;
1780+ out << " vix run api --replay\n " ;
1781+ out << " vix run main.cpp --replay\n " ;
17791782
17801783 out << " # Runtime targets\n " ;
17811784 out << " vix run docker://nginx\n " ;
0 commit comments