Content of a single command in the repl. The command may execute an external script or simply call flowR functions.

interface ReplCommand {
    aliases: string[];
    description: string;
    fn: ((output: ReplOutput, shell: RShell, remainingLine: string) => void | Promise<void>);
    script: boolean;
    usageExample: string;
}

Properties

aliases: string[]

Aliases of the command (without the leading colon), every alias must be unique (this is checked at runtime)

description: string

A human-readable description of what the command does

fn: ((output: ReplOutput, shell: RShell, remainingLine: string) => void | Promise<void>)

Function to execute when the command is invoked, it must not write to the command line but instead use the output handler. Furthermore, it has to obey the formatter defined in the ReplOutput.

script: boolean

Does the command invoke another script? this is mainly used to automatically generate two separate lists when asking for help

usageExample: string

Example of how to use the command, for example :slicer --help