(#17492) Fix --run_mode=foo global option parsing
Without this patch applied Puppet behaves as expected when given
--run_mode user, but not when given --run_mode=user. This is a
problem because The Foreman passes arguments to Puppet as a single
argument in the argument vector and this exceptional behavior is a
blocker for The Foreman supporting Puppet 3.
This patch fixes the problem by removing the --run_mode argument from
the argument vector after the option_parser is done processing. This
prevents subsequent option parsing from trying to process the option and
failing to do so.
Original commit message:
parse_global_options now supports --run_mode=foo style arguments as well
space-separated arguments.
Reviewed-by: Jeff McCune <jeff@puppetlabs.com>