Forge - Shell API 1.2.0.Final

org.jboss.forge.shell.plugins
Annotation Type Option


@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface Option

A command option.

Author:
Lincoln Baxter, III

Optional Element Summary
 Class<? extends CommandCompleter> completer
          Specify the command completer type that should be used for this option.
 String defaultValue
          The default value for this option, if not provided in user input.
 String description
           
 boolean flagOnly
          Sets whether or not the option is just a flag.
 String help
          Help text for this option.
 String name
          The name of this option.
 boolean required
          Specify whether or not this option is required.
 String shortName
          An optional short version of the flag name.
 PromptType type
          The prompt type to use when validating user input.
 

name

public abstract String name
The name of this option.

Default:
""

shortName

public abstract String shortName
An optional short version of the flag name.

Returns:
Default:
""

description

public abstract String description
Default:
""

flagOnly

public abstract boolean flagOnly
Sets whether or not the option is just a flag. Option must be a boolean in this case.

Default:
false

required

public abstract boolean required
Specify whether or not this option is required.

Default:
false

defaultValue

public abstract String defaultValue
The default value for this option, if not provided in user input.

Default:
""

help

public abstract String help
Help text for this option.

Default:
""

type

public abstract PromptType type
The prompt type to use when validating user input. This should be used carefully!

**WARNING** Since specifying a PromptType restricts user input, you need to make sure that the option type is compatible with this input, or exceptions may occur. (String or Object are your safest choices.)

Default:
org.jboss.forge.shell.PromptType.ANY

completer

public abstract Class<? extends CommandCompleter> completer
Specify the command completer type that should be used for this option. This may only be used with named options.

Default:
org.jboss.forge.shell.completer.NullCommandCompleter.class

Forge - Shell API 1.2.0.Final

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.