mcast app changes for karaf 4.2.1 CLI

Change-Id: Ieac2667bf0c0d6c5492ec96de124e9ab211d27ed
diff --git a/apps/mcast/cli/BUILD b/apps/mcast/cli/BUILD
index e692c4c..9a9d616 100644
--- a/apps/mcast/cli/BUILD
+++ b/apps/mcast/cli/BUILD
@@ -4,6 +4,6 @@
 ]
 
 osgi_jar(
-    import_packages = "*,org.onosproject.cli.net",
+    karaf_command_packages = ["org.onosproject.mcast.cli"],
     deps = COMPILE_DEPS,
 )
diff --git a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastGroupCompleter.java b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastGroupCompleter.java
index 9c4bddd..cf10dc5 100644
--- a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastGroupCompleter.java
+++ b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastGroupCompleter.java
@@ -16,6 +16,7 @@
 
 package org.onosproject.mcast.cli;
 
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onlab.packet.IpAddress;
 import org.onlab.util.Tools;
 import org.onosproject.cli.AbstractChoicesCompleter;
@@ -29,6 +30,7 @@
 /**
  * Mcast group Completer.
  */
+@Service
 public class McastGroupCompleter extends AbstractChoicesCompleter {
 
     @Override
diff --git a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastHostJoinCommand.java b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastHostJoinCommand.java
index eae5c48..32a72e0 100644
--- a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastHostJoinCommand.java
+++ b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastHostJoinCommand.java
@@ -16,10 +16,12 @@
 package org.onosproject.mcast.cli;
 
 import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.Option;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onlab.packet.IpAddress;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.net.HostIdCompleter;
 import org.onosproject.mcast.api.McastRoute;
 import org.onosproject.mcast.api.MulticastRouteService;
 import org.onosproject.net.HostId;
@@ -46,12 +48,14 @@
             description = "IP Address of the multicast group",
             valueToShowInHelp = "224.0.0.0",
             required = true, multiValued = false)
+    @Completion(McastGroupCompleter.class)
     String gAddr = null;
 
     @Option(name = "-srcs", aliases = "--sources",
             description = "Host sink format: MAC/VLAN",
             valueToShowInHelp = "00:00:00:00:00:00/None",
             multiValued = true)
+    @Completion(HostIdCompleter.class)
     String[] sources = null;
 
     @Option(name = "-sinks",
@@ -59,6 +63,7 @@
             description = "Host sink format: MAC/VLAN",
             valueToShowInHelp = "00:00:00:00:00:00/None",
             multiValued = true)
+    @Completion(HostIdCompleter.class)
     String[] sinks = null;
 
     @Override
diff --git a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastShowHostCommand.java b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastShowHostCommand.java
index 63fb015..7ab5da0 100644
--- a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastShowHostCommand.java
+++ b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastShowHostCommand.java
@@ -16,6 +16,7 @@
 package org.onosproject.mcast.cli;
 
 import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.Option;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onlab.packet.IpAddress;
@@ -46,6 +47,7 @@
             description = "IP Address of the multicast group",
             valueToShowInHelp = "224.0.0.0",
             required = false, multiValued = false)
+    @Completion(McastGroupCompleter.class)
     String gAddr = null;
 
     @Override
diff --git a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSinkDeleteCommand.java b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSinkDeleteCommand.java
index a6700e7..9c31111 100644
--- a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSinkDeleteCommand.java
+++ b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSinkDeleteCommand.java
@@ -16,10 +16,12 @@
 package org.onosproject.mcast.cli;
 
 import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.Option;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onlab.packet.IpAddress;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.net.HostIdCompleter;
 import org.onosproject.mcast.api.McastRoute;
 import org.onosproject.mcast.api.MulticastRouteService;
 import org.onosproject.net.HostId;
@@ -50,11 +52,13 @@
             description = "IP Address of the multicast group",
             valueToShowInHelp = "224.0.0.0",
             required = true, multiValued = false)
+    @Completion(McastGroupCompleter.class)
     String gAddr = null;
 
     @Option(name = "-s", aliases = "--sinks",
             description = "Host sink format: MAC/VLAN",
             valueToShowInHelp = "00:00:00:00:00:00/None")
+    @Completion(HostIdCompleter.class)
     String host = null;
 
     @Override
diff --git a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSourceDeleteCommand.java b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSourceDeleteCommand.java
index b4d07d6..757829c 100644
--- a/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSourceDeleteCommand.java
+++ b/apps/mcast/cli/src/main/java/org/onosproject/mcast/cli/McastSourceDeleteCommand.java
@@ -16,10 +16,12 @@
 package org.onosproject.mcast.cli;
 
 import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.Option;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onlab.packet.IpAddress;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.net.HostIdCompleter;
 import org.onosproject.mcast.api.McastRoute;
 import org.onosproject.mcast.api.MulticastRouteService;
 import org.onosproject.net.HostId;
@@ -50,12 +52,14 @@
             description = "IP Address of the multicast group",
             valueToShowInHelp = "224.0.0.0",
             required = true, multiValued = false)
+    @Completion(McastGroupCompleter.class)
     String gAddr = null;
 
     @Option(name = "-src", aliases = "--connectPoint",
             description = "Host sink format: MAC/VLAN",
             valueToShowInHelp = "00:00:00:00:00:00/None",
             multiValued = true)
+    @Completion(HostIdCompleter.class)
     String[] sourceList = null;