Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 214791 Details for
Bug 376319
[console] help - consider allowing for scope to be specfied
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for filtering commands according to scope
0001-bug-376319-console-help-consider-allowing-for-scope-.patch (text/plain), 2.70 KB, created by
Lazar Kirchev
on 2012-04-30 06:41:10 EDT
(
hide
)
Description:
Patch for filtering commands according to scope
Filename:
MIME Type:
Creator:
Lazar Kirchev
Created:
2012-04-30 06:41:10 EDT
Size:
2.70 KB
patch
obsolete
>From 7083fe1e6a1f8e2c3cdc167c0ca58a04b010d462 Mon Sep 17 00:00:00 2001 >From: Lazar Kirchev <l.kirchev@sap.com> >Date: Mon, 30 Apr 2012 13:38:16 +0300 >Subject: [PATCH] bug 376319 - [console] help - consider allowing for scope to > be specfied > >--- > .../equinox/console/commands/HelpCommand.java | 26 ++++++++++++++++--- > 1 files changed, 22 insertions(+), 4 deletions(-) > >diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/HelpCommand.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/HelpCommand.java >index 0a87326..8e4e0e6 100755 >--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/HelpCommand.java >+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/HelpCommand.java >@@ -89,6 +89,8 @@ public class HelpCommand { > /** > * Provides help for the available commands. Prints the names, descriptions and parameters of all registered commands. > * >+ * If -scope <command_scope> is passed to the command, help is printed only for the commands with the specified scope. >+ * > * If a command name is passed as argument to the help command, then the help > * message only for the particular command is displayed (if such is defined). > * >@@ -98,9 +100,19 @@ public class HelpCommand { > */ > public void help(final CommandSession session, String... args) throws Exception { > String command = null; >+ String scope = null; > > if (args.length > 0) { >- command = args[0]; >+ if (args[0].equals("-scope")) { >+ if (args.length < 2) { >+ System.out.println("Specify scope"); >+ return; >+ } else { >+ scope = args[1]; >+ } >+ } else { >+ command = args[0]; >+ } > } > > if (command != null) { >@@ -109,8 +121,11 @@ public class HelpCommand { > return; > } > >- printAllLegacyCommandsHelp(); >- printAllGogoCommandsHelp(session); >+ >+ if ((scope == null) || "equinox".equals(scope)) { >+ printAllLegacyCommandsHelp(); >+ } >+ printAllGogoCommandsHelp(session, scope); > } > > private void printGogoCommandHelp(final CommandSession session, String command) throws Exception { >@@ -127,12 +142,15 @@ public class HelpCommand { > } > } > >- private void printAllGogoCommandsHelp(final CommandSession session) throws Exception { >+ private void printAllGogoCommandsHelp(final CommandSession session, String scope) throws Exception { > @SuppressWarnings("unchecked") > Set<String> commandNames = (Set<String>) session.get(COMMANDS); > > try { > for (String commandName : commandNames) { >+ if (scope != null && !commandName.startsWith(scope + ":")) { >+ continue; >+ } > session.execute("felix:help " + commandName); > } > } catch (IllegalArgumentException e) { >-- >1.7.5.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 376319
: 214791 |
214795