Exemple #1
0
  public EnrouteCommand(bnd bnd, EnrouteOptions opts) throws Exception {
    this.bnd = bnd;
    this.opts = opts;

    List<String> args = opts._arguments();
    if (args.size() == 0) {
      // Default command
      printHelp();
    } else {
      // Other commands
      String cmd = args.remove(0);
      String help = opts._command().execute(this, cmd, args);
      if (help != null) {
        bnd.out.print(help);
      }
    }
  }
Exemple #2
0
 private void printHelp() throws Exception {
   Formatter f = new Formatter();
   opts._command().help(f, this);
   bnd.out.println(f);
   f.close();
 }