Examples of CommandRegistry


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

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

        }
    }

    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

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

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

        }
    }

    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

Examples of org.codehaus.groovy.tools.shell.CommandRegistry

    Groovysh shell = new Groovysh();

    // Install our error hook (exception handling)
    shell.setErrorHook(new MethodClosure(ThrowableDisplayer.class, "errorHook"));

    CommandRegistry registry = shell.getRegistry();
    @SuppressWarnings("unchecked")
    Iterator<Command> iterator = registry.iterator();
    while (iterator.hasNext()) {
      Command command = iterator.next();
      if (!commandsToKeep.contains(command.getName())) {
        iterator.remove();
        // remove from "names" set to avoid duplicate error.
        registry.remove(command);
      }
    }

    shell.register(new HelpCommand(shell));
    shell.register(new SetCommand(shell));
View Full Code Here

Examples of org.codehaus.groovy.tools.shell.CommandRegistry

    // Install our error hook (exception handling)
    shell.setErrorHook(
      new MethodClosure(ThrowableDisplayer.class, "errorHook"));
    ThrowableDisplayer.setIo(shell.getIo());

    CommandRegistry registry = shell.getRegistry();
    @SuppressWarnings("unchecked")
    Iterator<Command> iterator = registry.iterator();
    while (iterator.hasNext()) {
      Command command = iterator.next();
      if (!commandsToKeep.contains(command.getName())) {
        iterator.remove();
        // remove from "names" set to avoid duplicate error.
        registry.remove(command);
      }
    }

    shell.register(new HelpCommand(shell));
    shell.register(new SetCommand(shell));
View Full Code Here

Examples of org.codehaus.groovy.tools.shell.CommandRegistry

    Groovysh shell = new Groovysh();

    // Install our error hook (exception handling)
    shell.setErrorHook(new MethodClosure(ThrowableDisplayer.class, "errorHook"));

    CommandRegistry registry = shell.getRegistry();
    @SuppressWarnings("unchecked")
    Iterator<Command> iterator = registry.iterator();
    while (iterator.hasNext()) {
      Command command = iterator.next();
      if (!commandsToKeep.contains(command.getName())) {
        iterator.remove();
        // remove from "names" set to avoid duplicate error.
        registry.remove(command);
      }
    }

    shell.register(new HelpCommand(shell));
    shell.register(new SetCommand(shell));
View Full Code Here

Examples of org.infinispan.cli.CommandRegistry

   private Map<String, String> env = new HashMap<String, String>();

   public ContextImpl(IOAdapter outputAdapter, CommandBuffer commandBuffer) {
      this.commandBuffer = commandBuffer;
      this.outputAdapter = outputAdapter;
      this.commandRegistry = new CommandRegistry();
   }
View Full Code Here

Examples of org.infinispan.cli.CommandRegistry

   private Map<String, String> env = new HashMap<String, String>();

   public ContextImpl(IOAdapter outputAdapter, CommandBuffer commandBuffer) {
      this.commandBuffer = commandBuffer;
      this.outputAdapter = outputAdapter;
      this.commandRegistry = new CommandRegistry();
   }
View Full Code Here

Examples of org.infinispan.cli.CommandRegistry

   private Map<String, String> env = new HashMap<String, String>();

   public ContextImpl(IOAdapter outputAdapter, CommandBuffer commandBuffer) {
      this.commandBuffer = commandBuffer;
      this.outputAdapter = outputAdapter;
      this.commandRegistry = new CommandRegistry();
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.