private static CommandLine getCommandLine(String args[])
	{
		HelpFormatter formatter = new HelpFormatter();
		Options options = getOptions(args);
		CommandLineParser parser = new PosixParser();
		CommandLine cmd = null;
		try
		{
			cmd = parser.parse(options, args);
		}
		catch (ParseException e)
		{
			System.err.println("Error : " + e.getMessage());
			formatter.printHelp("Sort", options, true);
			System.exit(1);
		}

		if (cmd.hasOption("h"))
		{
			formatter.printHelp("Sort", options, true);
			System.exit(0);
		}

		if (!(SortHelper.getAlgorithmList().contains(cmd.getOptionValue("s"))))
		{
			System.err.println("Algorithm specified must be one of '"
					+ SortHelper.getAlgorithmList().toString() + "'");
			System.exit(1);
		}

		if (cmd.hasOption("n"))
			N = Integer.valueOf(cmd.getOptionValue("n"));

		if (cmd.hasOption("i"))
		{
			inputType = cmd.getOptionValue("i");
			if (!(SortHelper.getInputNatureList().contains(inputType)))
			{
				System.err
						.println("The Nature of input specified must be one of '"
								+ SortHelper.getInputNatureList().toString());
				System.exit(1);
			}

		}

		return cmd;
	}