List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:October 18 2010 3:35pm
Subject:Re: bzr commit into mysql-5.5-bugteam branch (kristofer.pettersson:3095)
Bug#54569
View as plain text  
Hi Kristofer,

On 10/8/10 8:30 AM, Kristofer Pettersson wrote:
> #At file:///home/thek/bzr/mysql-5.5-bugteam/ based on
> revid:bar@stripped
>
>   3095 Kristofer Pettersson	2010-10-08
>        Bug#54569 Some options are not allowed to take argument when passed with
> loose- prefix
>
>        Boolean options cause parsing failures when they are given
>        with prefix loose- and an argument, either in the command
>        line or in configuration file.
>
>        The reason was a faulty logic which forced the parsing
>        to throw an error when an argument of type NO_ARG was
>        used together with an argument which has been identified
>        as a key-value pair. Despite the attribute NO_ARG these
>        options actually take arguments if they are of type
>        BOOL.
>       @ mysys/my_getopt.c
>          * removed if-statement which prevented logic for handling boolean types with
> arguments to be executed.

OK to push. One minor comment below.

>      modified:
>        mysys/my_getopt.c
> === modified file 'mysys/my_getopt.c'
> --- a/mysys/my_getopt.c	2010-09-28 15:15:58 +0000
> +++ b/mysys/my_getopt.c	2010-10-08 11:30:49 +0000
> @@ -360,14 +360,6 @@ int handle_options(int *argc, char ***ar
>   	  }
>   	  return EXIT_OPTION_DISABLED;
>   	}
> -	if (must_be_var&&  optp->arg_type == NO_ARG)
> -	{
> -	  if (my_getopt_print_errors)
> -            my_getopt_error_reporter(ERROR_LEVEL,
> -                                     "%s: option '%s' cannot take an argument",
> -                                     my_progname, optp->name);
> -	  return EXIT_NO_ARGUMENT_ALLOWED;
> -	}
>           error= 0;
>   	value= optp->var_type&  GET_ASK_ADDR ?
>   	  (*getopt_get_addr)(key_name, (uint) strlen(key_name), optp,&error) :
>

Could you please add a comment in the headers and source code that, due 
to historical reasons, arguments for GET_BOOL are always accepted?

Thanks and regards,

Davi
Thread
bzr commit into mysql-5.5-bugteam branch (kristofer.pettersson:3095)Bug#54569Kristofer Pettersson8 Oct
Re: bzr commit into mysql-5.5-bugteam branch (kristofer.pettersson:3095)Bug#54569Davi Arnaut18 Oct