You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/09/18 10:55:29 UTC

karaf-cellar git commit: Add completers on cluster:features* commands

Repository: karaf-cellar
Updated Branches:
  refs/heads/master 47498a08a -> 09fecf936


Add completers on cluster:features* commands


Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/09fecf93
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/09fecf93
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/09fecf93

Branch: refs/heads/master
Commit: 09fecf936ff43849e5c3126d06d204333f4a3700
Parents: 47498a0
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Fri Sep 18 10:54:59 2015 +0200
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Fri Sep 18 10:54:59 2015 +0200

----------------------------------------------------------------------
 features/pom.xml                                                | 4 ++++
 .../karaf/cellar/features/shell/InstallFeatureCommand.java      | 2 ++
 .../org/apache/karaf/cellar/features/shell/RepoAddCommand.java  | 2 ++
 .../apache/karaf/cellar/features/shell/RepoRemoveCommand.java   | 2 ++
 .../karaf/cellar/features/shell/UninstallFeatureCommand.java    | 2 ++
 pom.xml                                                         | 5 +++++
 6 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/09fecf93/features/pom.xml
----------------------------------------------------------------------
diff --git a/features/pom.xml b/features/pom.xml
index 075e79f..f937a95 100644
--- a/features/pom.xml
+++ b/features/pom.xml
@@ -63,6 +63,10 @@
             <groupId>org.apache.karaf.features</groupId>
             <artifactId>org.apache.karaf.features.core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.features</groupId>
+            <artifactId>org.apache.karaf.features.command</artifactId>
+        </dependency>
 
         <!-- Logging -->
         <dependency>

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/09fecf93/features/src/main/java/org/apache/karaf/cellar/features/shell/InstallFeatureCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/InstallFeatureCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/InstallFeatureCommand.java
index 2a43ed6..6abd0f7 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/InstallFeatureCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/InstallFeatureCommand.java
@@ -26,6 +26,7 @@ import org.apache.karaf.cellar.features.Constants;
 import org.apache.karaf.cellar.features.FeatureState;
 import org.apache.karaf.features.FeatureEvent;
 import org.apache.karaf.features.FeaturesService;
+import org.apache.karaf.features.command.completers.AllFeatureCompleter;
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.Completion;
@@ -54,6 +55,7 @@ public class InstallFeatureCommand extends CellarCommandSupport {
     String groupName;
 
     @Argument(index = 1, name = "features", description = "The name and version of the features to install. A feature id looks like name/version. The version is optional.", required = true, multiValued = true)
+    @Completion(AllFeatureCompleter.class)
     List<String> features;
 
     @Reference

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/09fecf93/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
index b2fb881..b00a111 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
@@ -26,6 +26,7 @@ import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
 import org.apache.karaf.features.RepositoryEvent;
+import org.apache.karaf.features.command.completers.AvailableRepoNameCompleter;
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.Completion;
@@ -46,6 +47,7 @@ public class RepoAddCommand extends CellarCommandSupport {
     String groupName;
 
     @Argument(index = 1, name = "name/url", description = "Shortcut name of the features repository or the full URL", required = true, multiValued = false)
+    @Completion(AvailableRepoNameCompleter.class)
     String nameOrUrl;
 
     @Argument(index = 2, name = "version", description = "The version of the features repository if using features repository name as first argument. It should be empty if using the URL.", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/09fecf93/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
index 28a8370..df03c29 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
@@ -26,6 +26,7 @@ import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
 import org.apache.karaf.features.RepositoryEvent;
+import org.apache.karaf.features.command.completers.InstalledRepoNameCompleter;
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.Completion;
@@ -49,6 +50,7 @@ public class RepoRemoveCommand extends CellarCommandSupport {
     String groupName;
 
     @Argument(index = 1, name = "repository", description = "Name or url of the repository to remove", required = true, multiValued = false)
+    @Completion(InstalledRepoNameCompleter.class)
     String repository;
 
     @Option(name = "-u", aliases = {"--uninstall-all"}, description = "Uninstall all features contained in the features repositories", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/09fecf93/features/src/main/java/org/apache/karaf/cellar/features/shell/UninstallFeatureCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/UninstallFeatureCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/UninstallFeatureCommand.java
index d1f3dd1..9bc7620 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/UninstallFeatureCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/UninstallFeatureCommand.java
@@ -25,6 +25,7 @@ import org.apache.karaf.cellar.features.ClusterFeaturesEvent;
 import org.apache.karaf.cellar.features.Constants;
 import org.apache.karaf.cellar.features.FeatureState;
 import org.apache.karaf.features.FeatureEvent;
+import org.apache.karaf.features.command.completers.AllFeatureCompleter;
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.Completion;
@@ -44,6 +45,7 @@ public class UninstallFeatureCommand extends CellarCommandSupport {
     String groupName;
 
     @Argument(index = 1, name = "features", description = "The name and version of the features to uninstall. A feature id looks like name/version. The version is optional.", required = true, multiValued = true)
+    @Completion(AllFeatureCompleter.class)
     List<String> features;
 
     @Option(name = "-r", aliases = "--no-auto-refresh", description = "Do not automatically refresh bundles", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/09fecf93/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 73376d8..a542bfc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -221,6 +221,11 @@
                 <version>${karaf.version}</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.karaf.features</groupId>
+                <artifactId>org.apache.karaf.features.command</artifactId>
+                <version>${karaf.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.karaf</groupId>
                 <artifactId>org.apache.karaf.util</artifactId>
                 <version>${karaf.version}</version>