Enhanced app CLI.

apps now support -a|--active option to show only activated apps.

app command now takes a list of app ids to allow single command to activate/deactivate/uninstall multiple apps

Deprecated old CLI commands which were already not included in the run-time config.

Consolidated intent & topology metrics to use the same app id since they are bundled into the same app.

Added 'reinstall' and 'reinstall!' option to onos-app tool.

Change-Id: I1406843bf608acf8e7d969a547b929d056e77067
diff --git a/cli/src/main/java/org/onosproject/cli/app/ApplicationCommand.java b/cli/src/main/java/org/onosproject/cli/app/ApplicationCommand.java
index 4a0a9e0..68a1957 100644
--- a/cli/src/main/java/org/onosproject/cli/app/ApplicationCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/app/ApplicationCommand.java
@@ -38,9 +38,9 @@
             required = true, multiValued = false)
     String command = null;
 
-    @Argument(index = 1, name = "name", description = "Application name",
-            required = true, multiValued = false)
-    String name = null;
+    @Argument(index = 1, name = "names", description = "Application name(s)",
+            required = true, multiValued = true)
+    String[] names = null;
 
     @Override
     protected void execute() {
@@ -49,20 +49,22 @@
             print("Not supported via CLI yet.");
 
         } else {
-            ApplicationId appId = service.getId(name);
-            if (appId == null) {
-                print("No such application: %s", name);
-                return;
-            }
+            for (String name : names) {
+                ApplicationId appId = service.getId(name);
+                if (appId == null) {
+                    print("No such application: %s", name);
+                    return;
+                }
 
-            if (command.equals(UNINSTALL)) {
-                service.uninstall(appId);
-            } else if (command.equals(ACTIVATE)) {
-                service.activate(appId);
-            } else if (command.equals(DEACTIVATE)) {
-                service.deactivate(appId);
-            } else {
-                print("Unsupported command: %s", command);
+                if (command.equals(UNINSTALL)) {
+                    service.uninstall(appId);
+                } else if (command.equals(ACTIVATE)) {
+                    service.activate(appId);
+                } else if (command.equals(DEACTIVATE)) {
+                    service.deactivate(appId);
+                } else {
+                    print("Unsupported command: %s", command);
+                }
             }
         }
     }