cmdline: Restore support for arbitrary global option handling.
The recent port to Getopt::Long broke the ability to use --foo=bar type of options (where <foo> is a global option name known to the build context). It also replaced the --module,foo=bar options with --set-module-option-value=module,foo,bar. While it's possible to use the latter syntax for global options (by using 'global' as the module name) that is undocumented and may not work forever. And either way, --foo options did use to work, and I noted it was broken in the refactor. So now that someone else has noticed I've reimplemented the feature. It's difficult to do entirely from within Getopt::Long since the documentation for that module gives you essentially one catch-all, which only supports *non-options*. So what I've done instead is to have kdesrc-build dynamically introspect its list of global options and flags and then add them to the list of valid options we pass to Getopt::Long. This also should mean that we don't need to pass 'pass_through' as an option to Getopt::Long anymore, though we'll see. This code path won't be used for options that already have a command line option (such as --async/--no-async) so that is still a misfeature compared to how it was before, but I guess it can't be perfect. =D I've tried to ensure that "flags" support the 'false' value to mean boolean false, but be careful to pass false or 0 if that's what you mean... specifying --dont-foo without giving it a value defaults it to true. BUG:330386
parent
2f52754d
Please register or sign in to comment