elasticsearch/elasticsearch — pull request #6013 by pickypg (2014-05-02 05:18:01+00:00)
Title: bin/plugin tests for missing plugin name when passing --url

When setting the `--url`, it now sets the implied action--`INSTALL`. Therefore, if the user fails to supply the install flag themselves, then the plugin name will be caught as missing (also added to remove incase a future scenario allows that) and fail immediately.

Adding code to test for unset plugin names to fail fast with descriptive error messages (for all flags that require a value). Also simplified the series of `if` statements checking for the commands by using a `switch` (now that it's using Java 7), added tests, and updated random exceptions with the up-to-date flag names (e.g., "--verbose" instead of "-verbose").

@dadoonet Note: This will cause or have merge conflicts with #5977. I have no problem with my changes just being incorporated into that PR. Also, while messing with the unit tests, I noticed that the package for the tests is `org.elasticsearch.plugin` while the non-test code is `org.elasticsearch.plugins`. That's probably worth a cleanup by whoever loses the merge; I avoided doing it upfront to simplify any potential merge.

Closes #5976