public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {
return "add".equals(action.getValue(ctx.getParsedCommandLine())) && super.canAppearNext(ctx);
}
};
idProperty = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
@Override
public List<String> getAllCandidates(CommandContext ctx) {
List<Property> props = getNodeProperties(ctx);
if(props.isEmpty()) {
return Collections.emptyList();
}
final List<String> candidates = new ArrayList<String>();
for(Property prop : props) {
final ModelNode value = prop.getValue();
if(value.has("access-type") && "read-only".equals(value.get("access-type").asString())) {
candidates.add(prop.getName());
}
}
return candidates;
}}), "--property-id");
idProperty.addRequiredPreceding(nodePath);
commandName = new ArgumentWithValue(this, new DefaultCompleter(new CandidatesProvider(){
private final DefaultCallbackHandler callback = new DefaultCallbackHandler();
@Override
public List<String> getAllCandidates(CommandContext ctx) {