public static void main(String[] argv)
	{
		if(argv.length < 1)
		{
			System.out.println("Usage: ");
			System.out.println("irssi-log-parser "
					+ "<irssi log file> [<options> <output>]");
			return;
		}

		logFile = argv[0];

		Parser p = new Parser(logFile, false);
		long startTime = System.currentTimeMillis();
		try
		{
			p.parse();
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
		long timeTaken = System.currentTimeMillis() - startTime;

		if(argv.length > 2 && argv[1].equals("--json"))
		{
			// Change the output type to json with the given argument
			OUTPUT = Output.JSON;
			outFile = argv[2];
		}

		switch(OUTPUT)
		{
			case JSON:
				// JSON output
				String output = "{";
				output += "\"parseTime\" : " + timeTaken + ",";
				output += "\"parseDate\" : " + startTime + ",";
				output += "\"startDate\" : " + p.getStartDate().getMillis() + ",";
				output += "\"totalLines\" : " + p.getTotalLines() + ",";
				output += "\"hours\" : " + serializeArrayToJSON(p.getTotalHours()) + ",";
				output += "\"dates\" : " + serializeArrayToJSON(p.getLinesByDay()) + ",";
				output += "\"top\" : " + Person.serializePersonsCollectionToJson(p.getTopUsers());
				output += "}";
				PrintWriter writer;
				try
				{
					writer = new PrintWriter(outFile, "UTF-8");

					writer.write(output);

					writer.close();
				}
				catch(FileNotFoundException e)
				{
					e.printStackTrace();
				}
				catch(UnsupportedEncodingException e)
				{
					e.printStackTrace();
				}
				System.out.println("Done in " + timeTaken + "ms.");
				break;
			case TEXT:
				// Text Output
				System.out.println("Time Taken: " + timeTaken + "ms");
				break;
			default:
				// Default case
				break;
		}
	}