6

When you enter a command into the gogo shell, it looks first in the default scope for a match for that command. How do you configure what this default scope is?

For example, if you start up the Felix framework with gogo, it uses the felix scope as the default. But if you start up equinox 3.8.1, which now uses the felix shell as the default, it uses the equinox scope as default.

The main irritation is that when I type:

g! help

I get the results from equinox:help, instead of felix:help, so I'd like to make the felix scope the default.

Is there an OSGi framework property to configure this?

Lindsay Smith
  • 115
  • 2
  • 8
  • As far as I can tell, it's not specified anywhere _how_ this search occurs, except that the _first_ command found gets executed. This is also not part of OSGi specs unfortunately, so there is no detailed docs about this stuff either. I guess this is what happens when everyone starts making up their own standards. You can file a bug for this with felix project here: http://issues.apache.org/jira/browse/Felix I think they are relatively responsive. – Andriy Drozdyuk Dec 06 '12 at 10:33
  • Are you using SSH or Telnet to connect to the gogo shell, even transparently? Looks like here, equinox defaults to using EQUINOX_SCOPE by default. https://github.com/eclipse/rt.equinox.bundles/search?q=EQUINOX_SCOPE&type=Code Patching the bundle seems simple enough, but it looks like could be a limitation in how equinox uses the felix CommandSession in both of those, not providing a configurable way to use default scope. – Sheena Artrip Jun 16 '13 at 07:42

1 Answers1

3

The gogo shell, when starting up, will try to find a startup script. By default it will look in the folder (relative to your startup directory):

etc/gosh_profile

If it does not find a script there, the default script (inside org.apache.felix.gogo.shell) is used, which contains this line:

SCOPE = gogo:*

So, to change the default scope, provide your own script.

Marcel Offermans
  • 3,313
  • 1
  • 15
  • 23