/** * this method will traverse all arguments calling the processArgument method with each * argument. * * @param args the array of arguments. */ protected void processArguments(String[] args) { // traverse the args. for (int i = 0; i < args.length; i++) { try { processArgument(args, i); } catch (Exception e) { this.errorProcessingArguments(e.getMessage()); } } }
/** * this method is called if there is a catastrophic error processing arguments. It will report * the message, report the command syntax, and exit. * * @param message the error message to report before the command line syntax. */ protected void errorProcessingArguments(String message) { System.err.println(message); System.err.println(this.getCommandSyntax()); System.exit(-1); }
/** * Present a menu indicating the current display and providing an input menu, fetch the next * line, the process the assumed command there. */ @Override public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); System.err.println("Bye"); System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { System.err.println("Bye"); System.exit(0); } } }
/** * Present a menu indicating the current display and providing an input menu, fetch the next * line, the process the assumed command there. */ @Override public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); System.err.println("Bye"); System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { System.err.println("Bye"); System.exit(0); } } }
/** * this method will traverse all arguments calling the processArgument method with each * argument. * * @param args the array of arguments. */ protected void processArguments(String[] args) { // traverse the args. for (int i = 0; i < args.length; i++) { try { processArgument(args, i); } catch (Exception e) { this.errorProcessingArguments(e.getMessage()); } } }
/** * Present a menu indicating the current display and providing an input menu, fetch the next * line, the process the assumed command there. */ @Override public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); System.err.println("Bye"); System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { System.err.println("Bye"); System.exit(0); } } }
/** * this method is called if there is a catastrophic error processing arguments. It will report * the message, report the command syntax, and exit. * * @param message the error message to report before the command line syntax. */ protected void errorProcessingArguments(String message) { System.err.println(message); System.err.println(this.getCommandSyntax()); System.exit(-1); }
/** * this method will traverse all arguments calling the processArgument method with each * argument. * * @param args the array of arguments. */ protected void processArguments(String[] args) { // traverse the args. for (int i = 0; i < args.length; i++) { try { processArgument(args, i); } catch (Exception e) { this.errorProcessingArguments(e.getMessage()); } } }
/** * this method is called if there is a catastrophic error processing arguments. It will report * the message, report the command syntax, and exit. * * @param message the error message to report before the command line syntax. */ protected void errorProcessingArguments(String message) { System.err.println(message); System.err.println(this.getCommandSyntax()); System.exit(-1); }