Allow --option=value form of arguments
So that you can pass long options as ./test --option=value in addition to the currently supported ./test --option value. This is done by simply pre-parsing the argument list and splitting up any arguments that:
- Appear to be in the form
--option= - The "--option" part before the = is in the argument map (e.g. it's recognised)
- Are not present as a full "--option=value" option in the argument map
This latter is required because it's currently valid to have a full named option that includes "=" as part of its proper name. I've tried to be somewhat defensive on the tests to allow this existing use case.
This is somewhat requested as part of https://github.com/p-ranav/argparse/issues/67, though doesn't go as far as that issue suggests. The approach in this PR will work with multiple-argument options because of the rewrite, but it might not make complete sense to people expecting the more usual approach, which doesn't normally allow multiple arguments to an --longname option at all.