diff options
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]); |