Skip to content

Commit

Permalink
Using constant defined in ForgeCompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 29, 2013
1 parent c000ede commit df76212
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.jboss.aesh.cl.parser.CommandLineParser;
import org.jboss.aesh.cl.parser.ParserBuilder;
import org.jboss.forge.addon.convert.ConverterFactory;
import org.jboss.forge.addon.shell.aesh.completion.ForgeCompletion;
import org.jboss.forge.addon.shell.util.ShellUtil;
import org.jboss.forge.addon.ui.UICommand;
import org.jboss.forge.addon.ui.hints.InputType;
Expand Down Expand Up @@ -50,7 +51,8 @@ public CommandLineParser generateParser(UICommand command,
ParserBuilder builder = new ParserBuilder();

UICommandMetadata metadata = command.getMetadata();
ProcessedCommand parameter = new ProcessedCommand(ShellUtil.shellifyName(metadata.getName()), metadata.getDescription());
ProcessedCommand parameter = new ProcessedCommand(ShellUtil.shellifyName(metadata.getName()),
metadata.getDescription());

for (InputComponent<?, Object> input : inputs.values())
{
Expand All @@ -74,7 +76,7 @@ public CommandLineParser generateParser(UICommand command,
optionBuilder.shortName(input.getShortName());
}
ProcessedOption option = optionBuilder.create();
if (input.getName().equals("arguments"))
if (ForgeCompletion.ARGUMENTS_INPUT_NAME.equals(input.getName()))
{
parameter.setArgument(option);
}
Expand All @@ -97,7 +99,7 @@ public void populateUIInputs(CommandLine commandLine,
{
for (InputComponent<?, Object> input : inputs.values())
{
if (input.getName().equals("arguments"))
if (ForgeCompletion.ARGUMENTS_INPUT_NAME.equals(input.getName()))
{
InputComponents.setValueFor(converterFactory, input, commandLine.getArgument().getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ForgeCompletion implements Completion
/**
* the name of the arguments {@link InputComponent} (if exists)
*/
private static final String ARGUMENTS_INPUT_NAME = "arguments";
public static final String ARGUMENTS_INPUT_NAME = "arguments";

private ShellImpl shell;

Expand Down

0 comments on commit df76212

Please sign in to comment.