[Patch] add -h to nginx

Jérôme Loyet jerome at loyet.net
Tue Mar 24 16:26:54 MSK 2009


Le 24 mars 2009 14:15, Jérôme Loyet <jerome at loyet.net> a écrit :
> Hello,
>
> I attach a small patch which add the -h argument to nginx. As common
> programs, this arg show the available options.
>
> [root at wp0men04s /LIBRE/nginx/nginx-0.7.44]# ./objs/nginx -h
> Usage: nginx [-h] [-v] [-V] [-t] [-c filename] [-g param] [-d basedir]
>
> Options:
>        -h           : list available command line options (this page)
>        -v           : show version then exit
>        -V           : show version and configure options then exit
>        -c filename  : set conf file (default: /usr/local/nginx/conf/nginx.conf)
>        -g param     : set conf directive out of conf file
>
> nginx version: nginx/0.7.44
>
> Don't know if you're interested in such a patch. But the first time I
> tried nginx I was kind of lost on where to find available options.
>
> And I ask myself a question, why use those lines:
>        p = "nginx version: " NGINX_VER CRLF;
>        n = sizeof("nginx version: " NGINX_VER CRLF) - 1;
>
>        if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
>            return 1;
>        }
>
> instead of
>
>        p = "nginx version: " NGINX_VER CRLF;
>
>        if (ngx_write_fd(ngx_stderr_fileno, p, strlen(p)) != n) {
>            return 1;
>        }
>

Sorry I sent the wrong version of the patch. The right version is attached.
And in my previous question I meant:

 instead of

        p = "nginx version: " NGINX_VER CRLF;
        n = strlen(p);

        if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
            return 1;
        }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx-help.patch
Type: application/octet-stream
Size: 1363 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20090324/5df8a960/attachment.obj>


More information about the nginx mailing list