JsonReferenceCli { public static void main(String[] args) throws ParseException, JsonReferenceException, IOException { Options options = new Options(); Option helpOption = new Option("help", null); options.addOption(helpOption); CommandLineParser commandLineParser = new DefaultParser(); CommandLine commandLine = commandLineParser.parse(options, args); Boolean help = commandLine.hasOption("help"); if (help) { HelpFormatter helpFormatter = new HelpFormatter(); helpFormatter.printHelp("json-reference", options); return; } List<String> argsList = commandLine.getArgList(); File file = new File(argsList.get(0)); JsonReferenceProcessor processor = new JsonReferenceProcessor(); JsonNode jsonNode = processor.process(file); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.enable(SerializationFeature.INDENT_OUTPUT); objectMapper.writeValue(System.out, jsonNode); System.out.println(); }  static void main(String[] args);  }
@Test public void testMainHelp() throws Exception { JsonReferenceCli.main(new String[] { "-help" }); }
@Test public void testMainFile() throws Exception { JsonReferenceCli.main(new String[] { resource("a.json") }); }