blob: 71e56f10a56d42761f6b20f7ebcd1b141562db6f [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001package org.onlab.onos.cli;
2
3import org.apache.karaf.shell.commands.Argument;
4import org.apache.karaf.shell.commands.Command;
tom5ac51882014-08-27 18:10:33 -07005import org.onlab.onos.GreetService;
tom0eb04ca2014-08-25 14:34:51 -07006
7/**
8 * Simple command example to demonstrate use of Karaf shell extensions; shows
9 * use of an optional parameter as well.
10 */
11@Command(scope = "onos", name = "greet", description = "Issues a greeting")
tom6d2a43e2014-09-08 01:50:20 -070012public class GreetCommand extends AbstractShellCommand {
tom0eb04ca2014-08-25 14:34:51 -070013
14 @Argument(index = 0, name = "name", description = "Name to greet",
15 required = false, multiValued = false)
16 String name = "dude";
17
18 @Override
19 protected Object doExecute() throws Exception {
tom6d2a43e2014-09-08 01:50:20 -070020 print(getService(GreetService.class).yo(name));
tom0eb04ca2014-08-25 14:34:51 -070021 return null;
22 }
23}