You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by cs...@apache.org on 2017/01/26 17:18:37 UTC

karaf git commit: [KARAF-4958] Only show bundle name if no other is selected

Repository: karaf
Updated Branches:
  refs/heads/master c8f4f2e37 -> cacd9856a


[KARAF-4958] Only show bundle name if no other is selected


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

Branch: refs/heads/master
Commit: cacd9856ad7c93b5c448a3c99da1337292c6dc17
Parents: c8f4f2e
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Thu Jan 26 18:17:08 2017 +0100
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Thu Jan 26 18:18:10 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/karaf/bundle/command/List.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/cacd9856/bundle/core/src/main/java/org/apache/karaf/bundle/command/List.java
----------------------------------------------------------------------
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/List.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/List.java
index 656a5d6..e33638d 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/List.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/List.java
@@ -37,8 +37,8 @@ import java.util.ArrayList;
 @Service
 public class List extends BundlesCommand {
 
-    @Option(name = "--no-name", description = "Don't show bundle name", required = false, multiValued = false)
-    boolean dontShowName;
+    @Option(name = "-name", aliases="-n",  description = "Show bundle name", required = false, multiValued = false)
+    boolean showName;
 
     @Option(name = "-l", aliases = {}, description = "Show the locations", required = false, multiValued = false)
     boolean showLocation;
@@ -97,7 +97,9 @@ public class List extends BundlesCommand {
         table.column("Lvl").alignRight();
         table.column("Version");
 
-        if (!dontShowName) {
+        boolean effectiveShowName = showName || (!showLocation && !showSymbolic && !showUpdate && !showRevisions); 
+        
+        if (effectiveShowName) {
             table.column("Name");
         }
 
@@ -143,7 +145,7 @@ public class List extends BundlesCommand {
                 rowData.add(getStateString(info.getState()));
                 rowData.add(info.getStartLevel());
                 rowData.add(version);
-                if (!dontShowName) {
+                if (effectiveShowName) {
                     String bundleName = (info.getName() == null) ? info.getSymbolicName() : info.getName();
                     bundleName = (bundleName == null) ? info.getUpdateLocation() : bundleName;
                     String name = bundleName + printFragments(info) + printHosts(info);