Hi all,

The following code works in karaf (3.0.4) with the console and with IPOJO

@Component
@Instantiate
@Provides
public class SampleCommand {

    @ServiceProperty(name = "osgi.command.scope", value = "*")
    String scope;

    @ServiceProperty(name = "osgi.command.function", value = "{}")
    String[] function = new String[]{
        "testFct",
        "testFct2"
    };

....
....

    public void testFct(String... args) {
        System.out.println("Test");
    }

    public void testFct2() {
        System.out.println("Test2");
    }

}

My problem is how having a completion???? I try every thing, but nothing
works, for Ipojo it's the same, the tab shows only the command for system,
feature, etc.

If I type the command testfct, or ipojo:instances, it's works, but
unfortunately, I have not the completion!!!


@Component(propagation = true)
@Instantiate
//@Provides(specifications = Completer.class)
@Provides
public class SampleCompleter implements Completer {

    @Override
    public int complete(final String buffer, final int cursor, final
List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        delegate.getStrings().add("Mike");
        delegate.getStrings().add("Eric");
        delegate.getStrings().add("Jenny");
        return delegate.complete(buffer, cursor, candidates);
    }
}

Any suggestion?  

Thanks






--
View this message in context: 
http://karaf.922171.n3.nabble.com/Extending-karaf-command-tp4041458p4042825.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to