예제 #1
0
 public void error(Exception e) {
   Boolean debug = stack.local().get("debug");
   if (debug != null && debug) {
     System.out.print(Services.getStackTrace(e));
   } else {
     System.out.println(e);
   }
 }
예제 #2
0
 /*
  * (non-Javadoc)
  *
  * @see com.voladroid.ui.cli.Cli#start()
  */
 @Override
 public void start() {
   onStart();
   push(root);
   while (hasCommand()) {
     try {
       String[] cmd = nextCommand();
       Scope executor = stack.local().execute(cmd);
       if (executor != null) {
         executor.onEnter();
         push(executor);
       } else if (stack.empty()) {
         break;
       }
     } catch (Exception e) {
       error(e);
     }
   }
   onStop();
 }