private static boolean parseArgs(String[] args, BOMFactory bomFactory, PrintStream printStream) throws Exception {
      int urlCount = 0;
      boolean ok = false;

      for (int i=1; i<args.length; i++) {
	String arg = args[i];
	if ("-u".equals(arg)) {
	  if (i+1 >= args.length) {
	    throw new RuntimeException("Expected URL after \"-u\"");
	  }
	  ok = getUrl(args[++i]) || ok;
	} else if ("-nocache".equalsIgnoreCase(arg)) {
	    CachedUrlResolver.setIsCached(false);
	} else if ("-markdown".equalsIgnoreCase(arg)) {
	    bomFactory.setOutputType(BOMFactory.OutputType.MARKDOWN);
	} else if ("-csv".equalsIgnoreCase(arg)) {
	    bomFactory.setOutputType(BOMFactory.OutputType.CSV);
	} else if ("-html".equalsIgnoreCase(arg)) {
	    bomFactory.setOutputType(BOMFactory.OutputType.HTML);
	} else {
	    System.out.println("Resolving uri:" + arg);
	    URL url = new URL(arg);
	    urlCount++;
	    BOM bom = new BOM(url);
	    bom.resolve(0);
	    bomFactory.printBOM(printStream, bom, null);
	}
      }
      return ok || urlCount > 0;
    }