Improve handling of -v, -V, --version and --pants-version.
Review Request #3071 - Created Nov. 3, 2015 and submitted
All these could be used with no argument to print the version and exit.
However we also had a hack where these could take an argument. Pants code
itself didn't use this argument, it was just there to document the fact
that the setup script and the intellij plugin grepped for pants_version
Unfortunately supporting this required some argparse hackery, and I want
to move us off argparse altogether (as it's now just a minor implementation
detail of the options system). It was also pretty confusing to have a flag
that did different things depending on whether it had an argument or not.
So now -v, -V and --version are special-cased outside the options system, just like
the -h, -H and --help flags. And indeed they resemble help requests far more
than they resemble options.
--pants-version is now an untirely unrelated option, that always takes an
argument. Pants uses it to verify that it is running at the required version.
Scripts can grep it out of pants.ini, as before.
Note that this is backwards-incompatible: using --pants-version with no
argument now issues an error instead of printing the version. However
this doesn't seem like a big deal, as it was the least intuitive of the
version-printing flags anyway. Use -v, -V or --version for this.
CI passes: https://travis-ci.org/pantsbuild/pants/builds/89069922
Manually verified expected behaviors.
Can you add something to the summary that indicates this is a backwards incompatible change so that its easy to find for anyone doing a release? Just in case we have someone using scripts that we are unaware of, this will make it easier to track the problem down.
Status: Closed (submitted)