Netflix/governator — pull request #149 by elandau (2014-07-28 16:50:18+00:00)
Title: Governation/guicification of apache commons cli

Integrate apache commons cli with governator to make it easier to specify command line options and make them injectable.

Key features include
1. Guice module to simplify specifying cli options
2. Integraiton with governator's bootstrap mechanism.
3. Customize command line parser via a binding
4. Inject either apache commons's CommandLine or named bindings for each option

Example configuration,
```java
@GovernatorConfiguration
public static class MyBootstrap extends AbstractModule {
@Override
protected void configure() {
bind(ExampleMain.class).asEagerSingleton();

install(new OptionsModule() {
@Override
protected void configureOptions() {
option('f').hasArgs();
}
});
}
}
```

Example main,

```java
public class ExampleMain {
public static void main(final String args[]) {
Cli.start(MyBootstrap.class, args);
}

@Inject
public ExampleMain(@Named("f") String filename) {
System.out.println("filename=" + filename);
}

@PostConstruct
public void initialize() {
System.out.println("Application starting");
}

@PostConstruct
public void shutdown() {
System.out.println("Application stopping");
}
}
```