org.crsh.command
Interface ShellCommand

All Known Implementing Classes:
CRaSHCommand, GroovyScriptCommand, JCRCommand

public interface ShellCommand

The shell command allows a single source to provide a customized invoker according to the context of the arguments. More importantly it allows to decouple the obtention of a command related to its arguments from the actual execution of the command. This somewhat matters because the command execution pipeline has notion of consumed and produced types, thanks to this, the consumed and produced types can vary according to the arguments.

Version:
$Revision$
Author:
Julien Viet

Method Summary
 CommandCompletion complete(CommandContext context, String line)
          Provide completions for the specified arguments.
 CommandInvoker<?,?> createInvoker(String line)
          Provides an invoker for the specified arguments.
 String describe(String line, DescriptionFormat mode)
          Returns a description of the command or null if none can be found.
 

Method Detail

complete

CommandCompletion complete(CommandContext context,
                           String line)
Provide completions for the specified arguments.

Parameters:
context - the command context
line - the original command line arguments
Returns:
the completions

describe

String describe(String line,
                DescriptionFormat mode)
Returns a description of the command or null if none can be found.

Parameters:
line - the usage line
mode - the description mode
Returns:
the description

createInvoker

CommandInvoker<?,?> createInvoker(String line)
Provides an invoker for the specified arguments.

Parameters:
line - the command line arguments
Returns:
the command to provide


Copyright © 2012 eXo Platform SAS. All Rights Reserved.