mirror of
https://github.com/corda/corda.git
synced 2025-06-18 07:08:15 +00:00
Shell: add 'start' as an alias for 'flow start'.
This commit is contained in:
@ -26,6 +26,10 @@ public class FlowShellCommand extends InteractiveShellCommand {
|
|||||||
@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
||||||
@Usage("The data to pass as input") @Argument(unquote = false) List<String> input
|
@Usage("The data to pass as input") @Argument(unquote = false) List<String> input
|
||||||
) {
|
) {
|
||||||
|
startFlow(name, input, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void startFlow(@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name, @Usage("The data to pass as input") @Argument(unquote = false) List<String> input, RenderPrintWriter out) {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
out.println("You must pass a name for the flow, see 'man flow'", Color.red);
|
out.println("You must pass a name for the flow, see 'man flow'", Color.red);
|
||||||
return;
|
return;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package net.corda.node.shell;
|
||||||
|
|
||||||
|
// A simple forwarded to the "flow start" command, for easier typing.
|
||||||
|
|
||||||
|
import org.crsh.cli.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class StartShellCommand extends InteractiveShellCommand {
|
||||||
|
@Command
|
||||||
|
@Man("An alias for 'flow start'. Example: \"start Yo target: Some other company\"")
|
||||||
|
public void main(@Usage("The class name of the flow to run, or an unambiguous substring") @Argument String name,
|
||||||
|
@Usage("The data to pass as input") @Argument(unquote = false) List<String> input) {
|
||||||
|
FlowShellCommand.startFlow(name, input, out);
|
||||||
|
}
|
||||||
|
}
|
@ -102,7 +102,8 @@ object InteractiveShell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExternalResolver.INSTANCE.addCommand("run", "Runs a method from the CordaRPCOps interface on the node.", RunShellCommand::class.java)
|
ExternalResolver.INSTANCE.addCommand("run", "Runs a method from the CordaRPCOps interface on the node.", RunShellCommand::class.java)
|
||||||
ExternalResolver.INSTANCE.addCommand("flow", "Start a (work)flow on the node. This is how you can change the ledger.", FlowShellCommand::class.java)
|
ExternalResolver.INSTANCE.addCommand("flow", "Commands to work with flows. Flows are how you can change the ledger.", FlowShellCommand::class.java)
|
||||||
|
ExternalResolver.INSTANCE.addCommand("start", "An alias for 'flow start'", StartShellCommand::class.java)
|
||||||
val shell = ShellLifecycle(dir).start(config)
|
val shell = ShellLifecycle(dir).start(config)
|
||||||
|
|
||||||
if (runSSH) {
|
if (runSSH) {
|
||||||
|
Reference in New Issue
Block a user