Skip to content

Commit

Permalink
resolve compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
koentsje committed Jul 31, 2013
1 parent ea4c575 commit ce36cb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public boolean isStandalone()
public void complete(CompleteOperation completeOperation)
{
try {
ParameterInt param = context.getParser().getParameter();
ParameterInt param = context.getParser().getParameters().get(0);
// complete command names
if (param.getName().startsWith(completeOperation.getBuffer()))
completeOperation.addCompletionCandidate(param.getName());
Expand Down Expand Up @@ -186,7 +186,7 @@ private void defaultCompletion(CompleteOperation completeOperation) throws Comma
.findCompleteObject(completeOperation.getBuffer()));
}
else {
completeOperation.addCompletionCandidates(context.getParser().getParameter().getOptionLongNamesWithDash());
completeOperation.addCompletionCandidates(context.getParser().getParameters().get(0).getOptionLongNamesWithDash());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static CommandLineParser generateParser(UICommand command, ShellContext c
}
}
}
builder.parameter(parameter);
builder.addParameter(parameter);
return builder.generateParser();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public void testGenerateParser() throws Exception
foo1.initializeUI(context);
CommandLineParser parser = CommandLineUtil.generateParser(foo1, context);

assertEquals("foo1", parser.getParameter().getName());
assertEquals("foo1", parser.getParameters().get(0).getName());

Foo2Command foo2 = new Foo2Command();
foo2.initializeUI(context);
parser = CommandLineUtil.generateParser(foo2, context);

ParameterInt param = parser.getParameter();
ParameterInt param = parser.getParameters().get(0);
assertEquals("foo2", param.getName());
assertEquals("str", param.findLongOption("str").getName());
assertEquals("bool", param.findLongOption("bool").getName());
Expand Down

0 comments on commit ce36cb7

Please sign in to comment.