UNPKG

@launchql/cli

Version:
47 lines (46 loc) 1.31 kB
import { ParsedArgs } from 'minimist'; export declare const extractFirst: (argv: Partial<ParsedArgs>) => { first: string; newArgv: { _: string[]; "--"?: string[] | undefined; }; }; /** * Common CLI argument validation and processing utilities */ export interface ValidatedArgv extends ParsedArgs { cwd: string; database?: string; package?: string; to?: string; recursive?: boolean; yes?: boolean; tx?: boolean; fast?: boolean; logOnly?: boolean; createdb?: boolean; usePlan?: boolean; cache?: boolean; drop?: boolean; all?: boolean; summary?: boolean; help?: boolean; h?: boolean; } /** * Validates and normalizes common CLI arguments */ export declare function validateCommonArgs(argv: Partial<ParsedArgs>): ValidatedArgv; /** * Checks if required flags are provided when certain conditions are met */ export declare function validateFlagDependencies(argv: ValidatedArgv): void; /** * Logs the effective CLI arguments for debugging */ export declare function logEffectiveArgs(argv: ValidatedArgv, commandName: string): void; /** * Constructs a deployment target string from package and to arguments */ export declare function constructTarget(argv: ValidatedArgv, packageName?: string): string | undefined;