karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject karaf git commit: [KARAF-4958] Only show bundle name if no other is selected
Date Fri, 27 Jan 2017 07:45:48 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x e5f639998 -> 67772647c


[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/67772647
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/67772647
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/67772647

Branch: refs/heads/karaf-4.0.x
Commit: 67772647c6317fa4ebb030e1d2d500bfbc88ff0f
Parents: e5f6399
Author: Christian Schneider <chris@die-schneider.net>
Authored: Thu Jan 26 18:17:08 2017 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Fri Jan 27 08:45:39 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/67772647/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 000d3bd..dcc458a 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);


Mime
View raw message