diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-06-30 12:35:16 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-06-30 12:35:16 +0000 |
commit | b4fbdcf5d4bdaad5b762c2852c88123ed54a4bbb (patch) | |
tree | 66b1f911ac5d19ca710c753bbd15bf5a0dc505a4 /src/core/nginx.c | |
parent | b882154636c92aede2b682e4ae10c324d8d5cf35 (diff) | |
download | nginx-b4fbdcf5d4bdaad5b762c2852c88123ed54a4bbb.tar.gz nginx-b4fbdcf5d4bdaad5b762c2852c88123ed54a4bbb.zip |
-g switch
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r-- | src/core/nginx.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index 450edf374..fb4ac2616 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -637,8 +637,7 @@ ngx_getopt(ngx_cycle_t *cycle, int argc, char *const *argv) case 'c': if (argv[i + 1] == NULL) { ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, - "the option: \"%s\" requires file name", - argv[i]); + "the option \"-c\" requires file name"); return NGX_ERROR; } @@ -646,6 +645,17 @@ ngx_getopt(ngx_cycle_t *cycle, int argc, char *const *argv) cycle->conf_file.len = ngx_strlen(cycle->conf_file.data); break; + case 'g': + if (argv[i + 1] == NULL) { + ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, + "the option \"-g\" requires parameter"); + return NGX_ERROR; + } + + cycle->conf_param.data = (u_char *) argv[++i]; + cycle->conf_param.len = ngx_strlen(cycle->conf_param.data); + break; + default: ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "invalid option: \"%s\"", argv[i]); |