You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by gn...@apache.org on 2017/10/03 09:50:39 UTC

svn commit: r1810826 - /felix/trunk/gogo/jline/src/main/resources/gosh_profile

Author: gnodet
Date: Tue Oct  3 09:50:39 2017
New Revision: 1810826

URL: http://svn.apache.org/viewvc?rev=1810826&view=rev
Log:
[FELIX-5705] Provide completion for SCR commands

Modified:
    felix/trunk/gogo/jline/src/main/resources/gosh_profile

Modified: felix/trunk/gogo/jline/src/main/resources/gosh_profile
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/jline/src/main/resources/gosh_profile?rev=1810826&r1=1810825&r2=1810826&view=diff
==============================================================================
--- felix/trunk/gogo/jline/src/main/resources/gosh_profile (original)
+++ felix/trunk/gogo/jline/src/main/resources/gosh_profile Tue Oct  3 09:50:39 2017
@@ -278,6 +278,48 @@ try {
   complete -c gogo:wc -s w -l words --description "Print word count"
   complete -c gogo:wc -a '__files'
 
+  __get_scr_components = {
+    list = [ ]
+    scrref = ($.context getServiceReference org.osgi.service.component.runtime.ServiceComponentRuntime)
+    scr = ($.context getService $scrref)
+    each ($scr getComponentDescriptionDTOs ($.context bundles)) {
+      $list add ((($it getClass) getField "name") get $it)
+    }
+    $.context ungetService $scrref
+    $list
+  }
+  __get_bundles_with_scr_components = {
+    list = [ ]
+    scrref = ($.context getServiceReference org.osgi.service.component.runtime.ServiceComponentRuntime)
+    scr = ($.context getService $scrref)
+    each ($.context bundles) {
+      if { ($scr getComponentDescriptionDTOs $it) isEmpty } { } {
+        $list add ($it symbolicName)
+      }
+    }
+    $.context ungetService $scrref
+    $list
+  }
+
+  complete -c scr:config -e
+  complete -c scr:config -d "Show the current SCR configuration"
+
+  complete -c scr:disable -e
+  complete -c scr:disable -d "Disable an enabled component"
+  complete -c scr:disable -a '__get_scr_components'
+
+  complete -c scr:enable -e
+  complete -c scr:enable -d "Enable an disabled component"
+  complete -c scr:enable -a '__get_scr_components'
+
+  complete -c scr:info -e
+  complete -c scr:info -d "Dump information of a component or component configuration"
+  complete -c scr:info -a '__get_scr_components'
+
+  complete -c scr:list -e
+  complete -c scr:list -d "List component configurations of a specific bundle"
+  complete -c scr:list -a '__get_bundles_with_scr_components'
+
   # print welcome message
   __resolve_uri = {
     uri = $1