The @Option annotation seems to be what allows ‘–flags’ to be passed to tasks like ‘tasks’ and ‘help’. It would be cool if these were available to user-written tasks as well. Currently it doesn’t seem to be the case (import of that class from a gradle script fails) and in any case, the package is “internal”.
This could be used for customizing the execution of tasks. This is better than the current mechanisms for doing this viz. system properties and project properties, because Gradle can verify the option is valid for the task. Example use of this would be to replace the ‘test -Dtest.single=Foo -Dtest.debug=true’ mechanism with something like ‘test --single Foo --debug’.