[mapserver-dev] [gdal-dev] New env. var. to make it easier to test/debug web services

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Oct 2 13:18:27 PDT 2014


On 2014-10-02 5:09 PM, Even Rouault wrote:
> Le jeudi 02 octobre 2014 21:41:20, Jeff McKenna a écrit :
>> On 2014-10-02 4:24 PM, Even Rouault wrote:
>>> Le jeudi 02 octobre 2014 21:01:58, Even Rouault a écrit :
>>>> Le jeudi 02 octobre 2014 20:57:46, Lime, Steve D (MNIT) a écrit :
>>>>> How about making -nh set the environment variable programatically and
>>>>> losing the sendheaders checks?
>>>>
>>>> Yes, that's a possibility. Although I think -nh could just call a
>>>> function to disable the boolean in msio instead of messing with
>>>> environmenet variables.
>>>
>>> I've just implemented that. So no more env. variable trick. Just the
>>> standard -nh mechanism.
>>>
>>> Would be cool to have a "mapserv --help" mode to display available
>>> options, wouldn't it ?
>>
>> Would be super cool!  It would list the -nh and -v options (I don't know
>> of other options).
>
> With my latest commit, and default configuration :
>
> $ mapserv --help
> Usage: mapserv [--help] [-v] [-nh] [QUERY_STRING=value]
>
> Options :
>    -h, --help              Display this help message
>    -v                      Display version and exit.
>    -nh                     Suppress HTTP headers in CGI mode.
>    QUERY_STRING=value      Set the QUERY_STRING in GET request mode.
>
> When compiled with -DMS_ENABLE_CGI_CL_DEBUG_ARGS
>
> $ mapserv --help
> Usage: mapserv [--help] [-v] [-nh] [QUERY_STRING=value]
>                 [-tmpbase dirname] [-t mapfilename] [MS_ERRORFILE=value] [MS_DEBUGLEVEL=value]
>
> Options :
>    -h, --help              Display this help message
>    -v                      Display version and exit.
>    -nh                     Suppress HTTP headers in CGI mode.
>    QUERY_STRING=value      Set the QUERY_STRING in GET request mode.
>    -tmpbase dirname        Define a forced temporary directory.
>    -t mapfilename          Display the tokens of the mapfile after parsing.
>    MS_ERRORFILE=filename   Set error file.
>    MS_DEBUGLEVEL=value     Set debug level.

Wow that is great.

Why limit the other options with a specific compile setting though?

>
>
>> The default message is, not fully correct:
>>
>>     "This script can only be used to decode form results and should be
>> initiated as a CGI process via a httpd server"
>
> Any suggestion ?
>
How about:  "This script is commonly used to decode form results and 
should be initiated as a CGI process via an httpd server.  For other 
options please try using the --help switch."

-jeff





More information about the mapserver-dev mailing list