summaryrefslogtreecommitdiff
path: root/include/my_getopt.h
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@oracle.com>2010-10-25 14:30:07 +0200
committerKristofer Pettersson <kristofer.pettersson@oracle.com>2010-10-25 14:30:07 +0200
commit4b36063336775fa892a2b6b9b47d8b27ae44b4de (patch)
tree65a2b54a519e2427a60deb5842b07bbbb1eb8ac4 /include/my_getopt.h
parent401e6c909caad8f4d43a28d02ef51264d08cab3a (diff)
downloadmariadb-git-4b36063336775fa892a2b6b9b47d8b27ae44b4de.tar.gz
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. include/my_getopt.h: * More comments to help future refactoring mysys/my_getopt.c: * removed if-statement which prevented logic for handling boolean types with arguments to be executed. * Added comments to aid in future refactoring.
Diffstat (limited to 'include/my_getopt.h')
-rw-r--r--include/my_getopt.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 5eb0004e9c3..47feb21d85e 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -39,6 +39,13 @@ C_MODE_START
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
+/**
+ Enumeration of the my_option::arg_type attributes.
+ It should be noted that for historical reasons variables with the combination
+ arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
+ arguments. This is someone counter intuitive and care should be taken
+ if the code is refactored.
+*/
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct st_typelib;