@@ -253,6 +253,18 @@ namespace vix::commands::RunCommand
253253#endif
254254 }
255255
256+ static void apply_docs_env (const Options &opt)
257+ {
258+ if (!opt.docs .has_value ())
259+ return ;
260+
261+ #ifdef _WIN32
262+ _putenv_s (" VIX_DOCS" , (*opt.docs ? " 1" : " 0" ));
263+ #else
264+ ::setenv (" VIX_DOCS" , (*opt.docs ? " 1" : " 0" ), 1);
265+ #endif
266+ }
267+
256268 int run (const std::vector<std::string> &args)
257269 {
258270 Options opt = parse (args);
@@ -286,6 +298,7 @@ namespace vix::commands::RunCommand
286298
287299 apply_log_env (opt);
288300 vix::cli::manifest::apply_env_pairs (opt.runEnv );
301+ apply_docs_env (opt);
289302
290303#ifndef _WIN32
291304 ::setenv (" VIX_CLI_CLEAR" , opt.clearMode.c_str(), 1);
@@ -976,20 +989,25 @@ namespace vix::commands::RunCommand
976989
977990 out << " Runtime options:\n " ;
978991 out << " --cwd <path> Run the program with this working directory\n " ;
979- out << " --env <K=V> Add/ override one environment variable (repeatable)\n " ;
992+ out << " --env <K=V> Add or override one environment variable (repeatable)\n " ;
980993 out << " --args <value> Add one runtime argument (repeatable)\n\n " ;
981994
982995 out << " Watch / reload:\n " ;
983- out << " --watch, --reload Rebuild & restart on file changes\n " ;
996+ out << " --watch, --reload Rebuild and restart on file changes\n " ;
984997 out << " --force-server Treat process as long-lived (server-like)\n " ;
985998 out << " --force-script Treat process as short-lived (script-like)\n\n " ;
986999
9871000 out << " Script mode (single .cpp) flags:\n " ;
988- out << " --san Enable ASan + UBSan\n " ;
1001+ out << " --san Enable ASan and UBSan\n " ;
9891002 out << " --ubsan Enable UBSan only\n\n " ;
9901003
1004+ out << " Documentation (OpenAPI / Swagger):\n " ;
1005+ out << " --docs Enable auto docs (sets VIX_DOCS=1)\n " ;
1006+ out << " --no-docs Disable auto docs (sets VIX_DOCS=0)\n " ;
1007+ out << " --docs=<0|1|true|false> Explicitly control docs generation\n\n " ;
1008+
9911009 out << " Logging:\n " ;
992- out << " --log-level <level> debug | info | warn | error\n " ;
1010+ out << " --log-level <level> trace | debug | info | warn | error | critical | off \n " ;
9931011 out << " --verbose Alias for --log-level=debug\n " ;
9941012 out << " -q, --quiet Alias for --log-level=warn\n " ;
9951013 out << " --log-format <kv|json|json-pretty>\n " ;
@@ -1016,6 +1034,9 @@ namespace vix::commands::RunCommand
10161034 out << " vix run main.cpp -- -L/usr/lib -lssl\n " ;
10171035 out << " vix run main.cpp -- -DDEBUG\n\n " ;
10181036
1037+ out << " # Disable auto docs\n " ;
1038+ out << " vix run api.cpp --no-docs\n\n " ;
1039+
10191040 out << " # Manifest mode (.vix)\n " ;
10201041 out << " vix run api.vix\n " ;
10211042 out << " vix run api.vix --args --port --args 8080\n " ;
@@ -1034,6 +1055,7 @@ namespace vix::commands::RunCommand
10341055 out << " vix run example now_server\n\n " ;
10351056
10361057 out << " Environment:\n " ;
1058+ out << " VIX_DOCS 0|1 Enable or disable auto docs\n " ;
10371059 out << " VIX_LOG_LEVEL trace|debug|info|warn|error|critical|off\n " ;
10381060 out << " VIX_LOG_FORMAT kv|json|json-pretty\n " ;
10391061 out << " VIX_COLOR auto|always|never (NO_COLOR disables colors)\n " ;
0 commit comments