From c502941afeb02baa874035c4b0195cff54a05e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=BF=D0=BE=D0=B4=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BD?= Date: Thu, 28 Mar 2024 16:45:24 +0300 Subject: [PATCH] Committing updates. --- src/app/dm.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/app/dm.cpp b/src/app/dm.cpp index 05cf8c6..fcf9274 100644 --- a/src/app/dm.cpp +++ b/src/app/dm.cpp @@ -45,7 +45,7 @@ namespace Apostol { if (Config()->Flags().show_help) { std::cerr << "Usage: " APP_NAME << " [-?hvVt] [-s signal] [-c filename]" - " [-p prefix] [-g directives]" LINEFEED + " [-p prefix] [-g directives] [-w workers] [-l locale]" LINEFEED LINEFEED "Options:" LINEFEED " -?,-h : this help" LINEFEED @@ -53,13 +53,14 @@ namespace Apostol { " -V : show version and configure options then exit" LINEFEED " -t : test configuration and exit" LINEFEED " -s signal : send signal to a master process: stop, quit, reopen, reload" LINEFEED + " -c filename : set configuration file (default: " APP_CONF_FILE ")" LINEFEED #ifdef APP_PREFIX " -p prefix : set prefix path (default: " APP_PREFIX ")" LINEFEED #else " -p prefix : set prefix path (default: NONE)" LINEFEED #endif - " -c filename : set configuration file (default: " APP_CONF_FILE ")" LINEFEED " -g directives : set global directives out of configuration file" LINEFEED + " -w workers : set count of worker processes (default: 0 - automatically)" LINEFEED " -l locale : set locale (default: " APP_DEFAULT_LOCALE ")" LINEFEED << std::endl; } @@ -140,6 +141,19 @@ namespace Apostol { throw Delphi::Exception::Exception(_T("option \"-g\" requires parameter")); + case 'w': + if (*P) { + Config()->Workers(StrToIntDef(P, 0)); + goto next; + } + + if (++i < argc() && !argv()[i].empty()) { + Config()->Workers(StrToIntDef(argv()[i].c_str(), 0)); + goto next; + } + + throw Delphi::Exception::Exception(_T("option \"-w\" requires parameter")); + case 's': if (*P) { Config()->Signal(P); @@ -248,7 +262,7 @@ int main(int argc, char *argv[]) { int exitcode; - DefaultLocale.SetLocale("en-US"); + DefaultLocale.SetLocale(APP_DEFAULT_LOCALE); CDealModule dm(argc, argv);