public static void main(String[] args) {
    System.err.println("INDI for Java Basic Server initializing...");

    int port = 7624;

    for (int i = 0 ; i < args.length ; i++) {
      String[] s = splitArgument(args[i]);

      if (s[0].equals("-p")) {
        try {
          port = Integer.parseInt(s[1]);
        } catch (NumberFormatException e) {
          System.err.println("Incorrect port number");
          printArgumentHelp();
          System.exit(-1);
        }
      }
    }

    server = new INDIBasicServer(port);

    // Parse arguments
    for (int i = 0 ; i < args.length ; i++) {
      boolean correct = parseArgument(args[i]);

      if (!correct) {
        System.err.println("Argument '" + args[i] + "' not correct. Use -help for help. Exiting.");
        System.exit(-1);
      }
    }

    System.err.println("Type 'help' for help.");

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String line;

    try {
      while (true) {
        line = in.readLine();
        line = line.trim();

        if (line.length() > 0) {
          parseInputLine(line);
        }
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
  }