UNPKG

budgie-cli

Version:
38 lines (37 loc) 1.12 kB
import { ExitCode } from "../codes"; import { IFileSystem } from "../fileSystem"; import { ILogger } from "../logger"; import { IMain } from "../main"; import { IGlobAllAsync } from "../utils/glob"; /** * Dependencies to run the CLI. */ export interface ICliDependencies { /** * Raw argv-style string args from a command-line. */ argv: ReadonlyArray<string>; /** * System to read and write files, if not an fs-based default. */ fileSystem?: IFileSystem; /** * Finds file names from glob patterns, if not a glob-based default. */ globber?: IGlobAllAsync; /** * Logs information, if not the console. */ logger?: ILogger; /** * Main method to pass parsed arguments into. */ main?: IMain; } /** * Parses raw string arguments and, if they're valid, calls to a main method. * * @param dependencies Raw string arguments and any system dependency overrides. * @returns Promise for the result of the main method. */ export declare const cli: (dependencies: ICliDependencies) => Promise<ExitCode>;