The '--exists' option in pkg-config causes it to check the package dependency graph and exit silently, even if options like '--libs' are specified.
Similarly, '--list-all' option causes pkg-config to output the package list and exit even if other ('later') options are specified.
However, the '--print-variables' option doesn't follow either behavior. Most importantly, when used with '--exists', pkg-config first prints all the variables, and then exits with '--exists' result; but when used with other options like '--libs', it outputs both the variable list and other option output.
I think the '--print-variables' option should either follow suite of 'exiting' options or the regular output ones. For the former, it would need an exit(0) after outputting the variable list; for the latter, it would need to be moved after 'want_exists' conditional.
If you aren't interested in fixing this, please at least tell me which behavior is more correct in your opinion.
I fixed it the easy way in commit d6a1448 by just moving it after the wants_exists handling. The whole option handling needs a full sweep so options exit when they're done if they don't make sense to be used with other options. This just maintains the status quo, though.