----- Original Message -----
From: "Erik Hofman" <[EMAIL PROTECTED]>
> Index: options.cxx
> ***************
> *** 930,933 ****
> --- 933,943 ----
>
>   static int
> + fgOptDebugLevel( const char *arg )
> + {
> +     fgSetInt( "/sim/log-level", atoi( arg ) );
> +     return FG_OPTIONS_OK;
> + }
> +
> + static int
>   fgOptViewOffset( const char *arg )
>   {
> ***************
> *** 1153,1156 ****
> --- 1163,1167 ----
>       {"trace-read",                   true,  OPTION_FUNC,   "", false,
"", fgOptTraceRead },
>       {"trace-write",                  true,  OPTION_FUNC,   "", false,
"", fgOptTraceWrite },
> +     {"log-level",                  true,  OPTION_FUNC,   "", false, "",
fgOptDebugLevel },
>       {"view-offset",                  true,  OPTION_FUNC,   "", false,
"", fgOptViewOffset },
>       {"visibility",                   true,  OPTION_DOUBLE,
"/environment/visibility-m", false, "", 0 },

or simply
{"log-level", true,     OPTION_INT, "/sim/log-level", false,   "",      0}
FYI:
 option       has_param type        property         b_param s_param  func
where:
 option : name of the option
 has_param : option is --name=value if true or --name if false
 type : OPTION_BOOL - property is a boolean
        OPTION_STRING - property is a string
        OPTION_DOUBLE - property is a double
        OPTION_INT - property is an integer
        OPTION_CHANNEL - name of option is the name of a channel
        OPTION_FUNC - the option trigger a function
 b_param : if type==OPTION_BOOL, value set to the property (has_param is
false for boolean)
 s_param : if type==OPTION_STRING, value set to the property if has_param is
false
 func : function called if type==OPTION_FUNC. if has_param is true, the
value is passed
        to the function as a string, otherwise, 0 is passed.

For OPTION_DOUBLE and OPTION_INT, the parameter value is converted into a
double or an integer and set to the property.
For OPTION_CHANNEL, add_channel is called with the parameter value as the
argument.

I should have put that in a comment in the file at the first place.
Eric, can you add it for future reference.

BTW, the old way of testing options is ifdef'ed out and can be removed
now (look for NEW_OPTION_PARSING). Can you do it yourself our do you
want a patch ?

Cheers,
-Fred



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to