Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/arranger/jarl/shell/commands/HelpCommand.java


1   package com.arranger.jarl.shell.commands;
2   
3   import java.util.Iterator;
4   
5   /**
6    * HelpCommand created on Apr 16, 2003 
7    */
8   public class HelpCommand extends BaseCommand {
9   
10      public String getHelpText() {
11          return "displays this help text";
12      }
13  
14      public String getCommand() {
15          return "help";
16      }
17  
18      public void invoke(String[] args) throws Exception {
19          StringBuffer stringBuffer = new StringBuffer();
20          stringBuffer.append("CommandName  -->  Description").append(LINE_SEP);
21          for (Iterator it = m_jarlShell.getCommands().values().iterator(); it.hasNext();) {
22              BaseCommand baseCommand = (BaseCommand)it.next();
23              stringBuffer.append(baseCommand.getCommand());
24              stringBuffer.append("  -->  ");
25              stringBuffer.append(baseCommand.getHelpText());
26              stringBuffer.append(LINE_SEP);
27          }
28          m_jarlShell.out(stringBuffer.toString());
29      }
30  }