GlacierUploader { public static void main(String[] args) { final GlacierUploaderOptionParser optionParser = new GlacierUploaderOptionParser(setupConfig()); final OptionSet options; try { options = optionParser.parse(args); } catch (Exception e) { LOG.error("Something went wrong parsing the arguments", e); return; } String region = options.valueOf(optionParser.region); if(StringUtils.isBlank(region) && options.has(optionParser.endpoint)) { LOG.warn("Option {} is deprecated, please switch to {}", optionParser.endpoint, optionParser.region); String endpointUrl = options.valueOf(optionParser.endpoint); region = optionParser.parseEndpointToRegion(endpointUrl); LOG.debug("Parsed {} from configured endpoint", region , endpointUrl); } final List<? extends OptionSpec<? extends Serializable>> specs = Arrays.asList(optionParser.credentials); for(OptionSpec spec : specs) { if (options.has(spec)) { LOG.info("Option {} is deprecated, will be ignored", specs); } } if(region == null) { LOG.error("Region is not configured."); } findAndExecCommand(region, options, optionParser); } private  GlacierUploader(); static void main(String[] args); static CompositeConfiguration setupConfig(); static CompositeConfiguration setupConfig(File configFile);  }
@Test public void canRunGlacierUploader() { final String[] args = {"--help", "--endpoint", "eu-central-1", "--credentials", "foo.txt"}; GlacierUploader.main(args); }