@Override
	public int run(String[] args) throws Exception {
		if (args.length < 1) return -1;
		
		if (args[0].equalsIgnoreCase("runcrawler")) {
			int pageCount = 1;
			if (args.length > 1) {
				pageCount = Integer.valueOf(args[1]);
			}
			boolean outputContent = true;
			if (args.length > 2) {
				outputContent = (args[2].equalsIgnoreCase("outputcontent"));
			}
			runCrawler(pageCount, outputContent);
		} else if (args[0].equalsIgnoreCase("runanalyzer")) {
			boolean outputContent = true;
			if (args.length > 1) {
				outputContent = (args[1].equalsIgnoreCase("outputcontent"));
			}
			runAnalyzer(outputContent);
		} else if (args[0].equalsIgnoreCase("all")) {
			int pageCount = 1;
			if (args.length > 1) {
				pageCount = Integer.valueOf(args[1]);
			}
			boolean outputContent = true;
			if (args.length > 2) {
				outputContent = (args[2].equalsIgnoreCase("outputcontent"));
			}
			runCrawler(pageCount, outputContent);
			runAnalyzer(outputContent);
		} 
		
		return 0;
	}