Ignore:
Timestamp:
08/31/12 12:03:53 (12 years ago)
Author:
sherbold
Message:
  • listCommands now lists the commands ordered by the package
File:
1 edited

Legend:

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

    r664 r731  
    2727        Command[] commands = CommandExecuter.getInstance().getAvailableCommands(); 
    2828 
    29         for (Command command : commands) { 
    30             Console.println(command.help()); 
     29        List<String> commandPackages = CommandExecuter.getInstance().getCommandPackages(); 
     30         
     31        for( String commandPackage : commandPackages ) { 
     32            Console.println(commandPackage); 
     33            for (Command command : commands) { 
     34                if( commandPackage.equals(command.getClass().getPackage().getName())) { 
     35                    Console.println("   " + command.help()); 
     36                } 
     37            } 
    3138        } 
    3239    } 
Note: See TracChangeset for help on using the changeset viewer.