commit 01105a5401d8b606c9d8327aa2ec2e48af826e55 from: Aleksey Ryndin date: Thu Jul 04 13:37:27 2024 UTC Add VGI command line argument commit - 1c28a66db2ffd7c814ef25b21571069cb0f7f7a3 commit + 01105a5401d8b606c9d8327aa2ec2e48af826e55 blob - 1f1e2b7aecd1bb638f36b78758a34a75065213d9 blob + 36642223663b3697adb5642f2be7ef895c432922 --- vostok/args.cc +++ vostok/args.cc @@ -29,6 +29,7 @@ bool usage(const char *program) error::g_log << "\t-k FILE : Server key file [REQUIRED]" << std::endl; error::g_log << "\t-f PATH : Path to file system data [REQUIRED]" << std::endl; error::g_log << "\t-m FILE : Path to file mime.types" << std::endl; + error::g_log << "\t-g PATH : VGI (CGI-like) path part. Must NOT contain a separator (slash: /)" << std::endl; return false; } @@ -45,7 +46,7 @@ parse_command_line_arguments( { int ch; char *p = nullptr; - while ((ch = getopt(argc, argv, "a:p:c:k:f:m:")) != -1) { + while ((ch = getopt(argc, argv, "a:p:c:k:f:m:g:")) != -1) { switch (ch) { case 'a': args.addr = optarg; @@ -83,6 +84,9 @@ parse_command_line_arguments( if (!args.mime.parse_db(optarg)) return false; break; + case 'g': + args.vgi = optarg; + break; default: return usage(argv[0]); blob - a9a2b6a44858304b3e76f8adca2f76bcc73105fb blob + 83e0e5c50e2ac5ce8db054983ad855cb281b9f34 --- vostok/args.h +++ vostok/args.h @@ -18,6 +18,7 @@ struct CommandLineArguments czstring key_file{nullptr}; UniqueFd directory; Mime mime; + czstring vgi{nullptr}; };