use of com.beust.jcommander.JCommander in project gocd by gocd.
the class AgentCLI method printUsageAndExit.
private void printUsageAndExit(int exitCode) {
StringBuilder out = new StringBuilder();
JCommander jCommander = new JCommander(new AgentBootstrapperArgs());
jCommander.setProgramName("java -jar agent-bootstrapper.jar");
jCommander.usage(out);
stderr.print(out);
exit(exitCode);
}
use of com.beust.jcommander.JCommander in project jlineup by otto-de.
the class Main method main.
public static void main(String[] args) throws Exception {
final Parameters parameters = new Parameters();
final JCommander jCommander = new JCommander(parameters);
jCommander.parse(args);
jCommander.setProgramName("JLineup");
if (parameters.isHelp()) {
jCommander.usage();
System.out.printf("Version: %s%n", Util.getVersion());
return;
}
if (parameters.isVersion()) {
System.out.printf("JLineup version %s", Util.getVersion());
return;
}
if (parameters.isDebug()) {
Util.setLogLevelToDebug();
}
Config config = null;
try {
config = buildConfig(parameters);
} catch (FileNotFoundException e) {
System.exit(1);
}
if (parameters.isPrintConfig()) {
System.out.println(Util.createPrettyConfigJson(config));
System.exit(0);
}
JLineupOptions jLineupOptions = new JLineupOptions(parameters);
JLineup jLineup = new JLineup(config, jLineupOptions);
int errorLevel = jLineup.run();
if (errorLevel != 0) {
System.exit(errorLevel);
}
}
use of com.beust.jcommander.JCommander in project jlineup by otto-de.
the class ScreenshotsComparatorTest method setup.
@Before
public void setup() {
initMocks(this);
parameters = new Parameters();
JCommander jCommander = new JCommander(parameters);
jCommander.parse("-d", "src/test/resources/");
config = configBuilder().withUrls(ImmutableMap.of("http://url", new UrlConfig(ImmutableList.of("/"), 0.05f, null, null, null, null, ImmutableList.of(1001), 10000, 2, 0, 0, 0, null, 5))).withWindowHeight(WINDOW_HEIGHT).build();
testee = new ScreenshotsComparator(parameters, config, fileService, imageService);
}
Aggregations