UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

66 lines (65 loc) 2.82 kB
import type { ReplCodeCommand, ReplCommand } from './repl-main'; import type { OptionDefinition } from 'command-line-usage'; import { scripts } from '../../common/scripts-info'; import type { FlowrConfig } from '../../../config'; export declare const helpCommand: ReplCommand; /** * All commands that should be available in the REPL. */ declare const _commands: { readonly help: ReplCommand; readonly quit: ReplCommand; readonly version: ReplCommand; readonly execute: ReplCommand; readonly parse: ReplCodeCommand; readonly normalize: ReplCodeCommand; readonly 'normalize*': ReplCodeCommand; readonly 'normalize#': ReplCodeCommand; readonly dataflow: ReplCodeCommand; readonly 'dataflow*': ReplCodeCommand; readonly dataflowsimple: ReplCodeCommand; readonly 'dataflowsimple*': ReplCodeCommand; readonly dataflowascii: ReplCodeCommand; readonly dataflowsilent: ReplCodeCommand; readonly controlflow: ReplCodeCommand; readonly 'controlflow*': ReplCodeCommand; readonly controlflowbb: ReplCodeCommand; readonly 'controlflowbb*': ReplCodeCommand; readonly query: ReplCodeCommand; readonly 'query*': ReplCodeCommand; readonly signature: ReplCodeCommand; }; export type ReplCommandNames = keyof typeof _commands | keyof typeof scripts; /** * The args a master script is forked with: `remainingLine` tokenized, plus `--config-json <analyzer.flowrConfig>` * so it sees the repl's current (possibly `:query \@config`-edited) config -- unless the script does not support * that option, or the user already named a config themselves. */ export declare function masterScriptArgs(remainingLine: string, config: FlowrConfig, scriptOptions: readonly OptionDefinition[]): string[]; /** * Retrieve all REPL commands (including those generated from master scripts) */ export declare function getReplCommands(): Record<string, ReplCommand | ReplCodeCommand>; /** * The names of all commands including their aliases (but without the leading `:`) */ export declare function getCommandNames(): string[]; /** * Get the command for a given command name or alias. * @param command - The name of the command (without the leading `:`) */ export declare function getCommand(command: string): ReplCodeCommand | ReplCommand | undefined; /** * Formats the given argument name as a command line option (with single or double dashes). */ export declare function asOptionName(argument: string): string; /** * Retrieve the length of the longest command name (including star and brackets if applicable) */ export declare function longestCommandName(): number; /** * Pad the given command string to the length of the longest command name plus two spaces. * @see {@link longestCommandName} */ export declare function padCmd<T>(string: T): string; export {};