[Patch] add -h to nginx

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


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;
        }

Thanks
++ Jerome
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginx-help.patch
Type: application/octet-stream
Size: 1366 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20090324/06544482/attachment.obj>


More information about the nginx mailing list