package google;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import google.main.ResultProcessor;

@SpringBootApplication
public class ResultCounter implements CommandLineRunner {

	static {
		System.setProperty("logFilename", "log4j2.log");
	}

	@Autowired
	private ResultProcessor resultProcessor;

	/*
	 * If you want to see the database, type '--show-db'. If you want to get sorted
	 * or remove answers, type '--sort' or '--remove', respectively, as the first
	 * argument.
	 */
	public static void main(String... args) {
		SpringApplication.run(ResultCounter.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		resultProcessor.process(args);
	}

}

@@ -491,52 +491,311 @@
 %0A%09/*
+*
 %0A%09 * 
-If you want to see the database, type '
+The main method of the application.%0A%09 * %0A%09 * The first argument can be one of the following flags:%0A%09 * %3Cul%3E%0A%09 * %3Cli%3E%3Cb%3E--clear-db%3C/b%3E if you want to remove all data stored in the%0A%09 * database;%3C/li%3E%0A%09 * %3Cli%3E%3Cb%3E--remove%3C/b%3E if you want to remove specific data from the%0A%09 * database;%3C/li%3E%0A%09 * %3Cli%3E%3Cb%3E
 --sh
@@ -803,12 +803,14 @@
 w-db
-'. I
+%3C/b%3E i
 f yo
@@ -823,110 +823,333 @@
  to 
-get sorted%0A%09 * or remove answers, type '--sort' or '--remove', respectively, as the first%0A%09 * argument
+see the whole database.%3C/li%3E%0A%09 * %3C/ul%3E%0A%09 * By default, if no flag is passed, the app prints the number of results found%0A%09 * by Google for the given arguments. In such a case the answer is sorted%0A%09 * descending with respect to popularity.%0A%09 * %0A%09 * @param args%0A%09 *            Arguments to be processed, the first one can a flag
 .%0A%09 

Update Java doc of the main method.