Support short-form task subsystem flags.

Review Request #2466 — Created July 12, 2015 and submitted

For example, `./pants test.junit --jvm-options=foobar <target>` will set
the jvm options on the test.junit task's instance of the JVM subsystem.

`./pants --jvm-options=foobar test <target>` will, as before, set the
jvm options on the global JVM subsystem, and you can still fully-qualify
the task one: `./pants --test-junit-jvm-options=foobar test <target>`.

Tests for new functionality added.

CI passes:

  1. Thanks Benjy!

  2. Wonderful cleanup in here!

  3. Since there is already a global registered option jvm_options, is the value applied to both registrations?

    1. The "global option" you refer to is actually '--options', registered in the 'jvm' scope, i.e., the global JVM subsystem. There's no global --jvm-options registered anywhere, afaict. So that's the only place it's applied. Of course all the task-specific JVM subsystems inherit those values.

      What I've implemented here is uniform in the sense that you specify subsystem options in the same way in global scope (for the global instance) as you do in task scope (for the task-specific instance), and this is exactly how non-subsystem recursive options are specified. So, complicated as it all is, it is at least consistent...

    2. Ah, you're right... things like checkstyle/scalastyle/linter are using locally-registered jvm_options, which just happen to pick up the contents of the [DEFAULT] section. Makes sense.

    3. Yeah, among the confusions of the options system is that there are two orthogonal inheritance schemes - the one we implemented in the options system, and the one implemented by Python's config library. We could eliminate non-intentional use of the second by having global options belong to a [GLOBAL] config section, instead of to [DEFAULT].

    4. I like that idea.
    5. Filed an issue:

  1. Thanks for the quick review!

Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as 3fcfb09127585f25b9490cf9265a89ebbd729e08.