Ignore:
Timestamp:
08/28/12 13:33:23 (12 years ago)
Author:
sherbold
Message:
  • modified Command.help(): the help now returns a string with its usage instead of writing directly to the console
  • modified listCommands: now writes the help string of each command instead of just the name; this way, the parameters are displayed directly
  • moved listCommands from quest-ui-core to java-utils
Location:
trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexec.java

    r639 r664  
    6363         */ 
    6464        @Override 
    65         public void help() { 
    66                 Console.println("Usage: exec <filename>"); 
     65        public String help() { 
     66                return "exec <filename>"; 
    6767        } 
    6868} 
  • trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexit.java

    r175 r664  
    44 
    55import de.ugoe.cs.util.console.Command; 
    6 import de.ugoe.cs.util.console.Console; 
    76 
    87/** 
     
    2221         */ 
    2322        @Override 
    24         public void help() { 
    25                 Console.println("Usage: exit"); 
     23        public String help() { 
     24                return "exit"; 
    2625        } 
    2726 
  • trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDlistCommands.java

    r663 r664  
    11 
    2 package de.ugoe.cs.quest.ui.commands; 
     2package de.ugoe.cs.util.console.defaultcommands; 
    33 
    44import java.util.List; 
     
    2525    @Override 
    2626    public void run(List<Object> parameters) { 
    27         String[] commands = CommandExecuter.getInstance().getAvailableCommands(); 
     27        Command[] commands = CommandExecuter.getInstance().getAvailableCommands(); 
    2828 
    29         for (String command : commands) { 
    30             Console.println(command); 
     29        for (Command command : commands) { 
     30            Console.println(command.help()); 
    3131        } 
    3232    } 
     
    3838     */ 
    3939    @Override 
    40     public void help() { 
    41         Console.println("Usage: listCommands"); 
     40    public String help() { 
     41        return "listCommands"; 
    4242    } 
    4343 
Note: See TracChangeset for help on using the changeset viewer.