Package org.apache.geronimo.gshell.registry

Examples of org.apache.geronimo.gshell.registry.CommandRegistry


  private CommandRegistry getCommandRegistry() {
    return ShellContext.get().getCommandRegistry();
  }

  private void displayGroupCommands(final GroupNode group) throws Exception {
        CommandRegistry commandRegistry=getCommandRegistry();
        int maxNameLen = 20; // FIXME: Figure this out dynamically

        // First display command/aliases nodes
        for (Node child : group.nodes()) {
            if (child instanceof CommandNode) {
                try {
                    CommandNode node = (CommandNode) child;
                    String name = StringUtils.rightPad(node.getName(), maxNameLen);

                    Command command = commandRegistry.lookup(node.getId());
                    String desc = command.getDescription();

                    io.out.print("  ");
                    io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));
View Full Code Here


        }
    }

    private void displayCommandHelp(final String path) throws Exception {
        assert path != null;
        CommandRegistry commandRegistry=getCommandRegistry();

        Command cmd = commandRegistry.lookup(path);

        if (cmd == null) {
            io.out.println("Command " + Renderer.encode(path, Code.BOLD) + " not found.");
            io.out.println("Try " + Renderer.encode("help", Code.BOLD) + " for a list of available commands.");
        }
View Full Code Here

  private CommandRegistry getCommandRegistry() {
    return ShellContext.get().getCommandRegistry();
  }

  private void displayGroupCommands(final GroupNode group) throws Exception {
        CommandRegistry commandRegistry=getCommandRegistry();
        int maxNameLen = 20; // FIXME: Figure this out dynamically

        // First display command/aliases nodes
        for (Node child : group.nodes()) {
            if (child instanceof CommandNode) {
                try {
                    CommandNode node = (CommandNode) child;
                    String name = StringUtils.rightPad(node.getName(), maxNameLen);

                    Command command = commandRegistry.lookup(node.getId());
                    String desc = command.getDescription();

                    io.out.print("  ");
                    io.out.print(renderer.render(Renderer.encode(name, Code.BOLD)));
View Full Code Here

        }
    }

    private void displayCommandHelp(final String path) throws Exception {
        assert path != null;
        CommandRegistry commandRegistry=getCommandRegistry();

        Command cmd = commandRegistry.lookup(path);

        if (cmd == null) {
            io.out.println("Command " + Renderer.encode(path, Code.BOLD) + " not found.");
            io.out.println("Try " + Renderer.encode("help", Code.BOLD) + " for a list of available commands.");
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gshell.registry.CommandRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.