GNOME Bugzilla – Bug 305576
Make glib require argument to G_OPTION_ARG_STRING options.
Last modified: 2005-05-27 18:30:52 UTC
If you specify an option like this: {"foo", 0, 0, G_OPTION_ARG_STRING, &bar, NULL, NULL} and call your program with ./program --foo, glib thinks that you sent an empty string ("") as option foo's value. It is not quite right and different from how getopt and popt does it. Instead it should throw an error with the message "Missing argument to option --foo".
2005-05-27 Matthias Clasen <mclasen@redhat.com> * glib/goption.c (parse_short_option, parse_long_option): Return an error if an option is missing its argument. (#305576, Björn Lindqvist) * tests/option-test.c (missing_arg_test): Add a testcase.