CORDA-1075 - Add "bye" and "help" to crash shell menu(#2600)

* shell: list commands alphabetically

* increased crash shell version

* crash shell with help and bye
This commit is contained in:
Andrzej Grzesik 2018-02-22 11:15:28 +00:00 committed by Katelyn Baker
parent 3ac2de0ede
commit a3abc1d2a5
2 changed files with 5 additions and 3 deletions

View File

@ -61,7 +61,7 @@ buildscript {
ext.dependency_checker_version = '3.1.0' ext.dependency_checker_version = '3.1.0'
ext.commons_collections_version = '4.1' ext.commons_collections_version = '4.1'
ext.beanutils_version = '1.9.3' ext.beanutils_version = '1.9.3'
ext.crash_version = 'cce5a00f114343c1145c1d7756e1dd6df3ea984e' ext.crash_version = 'cadb53544fbb3c0fb901445da614998a6a419488'
ext.jsr305_version = constants.getProperty("jsr305Version") ext.jsr305_version = constants.getProperty("jsr305Version")
ext.shiro_version = '1.4.0' ext.shiro_version = '1.4.0'
ext.artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion') ext.artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion')

View File

@ -36,8 +36,10 @@ public class RunShellCommand extends InteractiveShellCommand {
private void emitHelp(InvocationContext<Map> context, StringToMethodCallParser<CordaRPCOps> parser) { private void emitHelp(InvocationContext<Map> context, StringToMethodCallParser<CordaRPCOps> parser) {
// Sends data down the pipeline about what commands are available. CRaSH will render it nicely. // Sends data down the pipeline about what commands are available. CRaSH will render it nicely.
// Each element we emit is a map of column -> content. // Each element we emit is a map of column -> content.
Map<String, String> cmdsAndArgs = parser.getAvailableCommands(); Set<Map.Entry<String, String>> entries = parser.getAvailableCommands().entrySet();
for (Map.Entry<String, String> entry : cmdsAndArgs.entrySet()) { ArrayList<Map.Entry<String, String>> entryList = new ArrayList<>(entries);
entryList.sort(Comparator.comparing(Map.Entry::getKey));
for (Map.Entry<String, String> entry : entryList) {
// Skip these entries as they aren't really interesting for the user. // Skip these entries as they aren't really interesting for the user.
if (entry.getKey().equals("startFlowDynamic")) continue; if (entry.getKey().equals("startFlowDynamic")) continue;
if (entry.getKey().equals("getProtocolVersion")) continue; if (entry.getKey().equals("getProtocolVersion")) continue;