diff --git a/src/command.ts b/src/command.ts index 0c358f4..9c87b3c 100644 --- a/src/command.ts +++ b/src/command.ts @@ -10,6 +10,7 @@ export function defineCommand( export interface RunCommandOptions { rawArgs: string[]; + data?: any; showUsage?: boolean; } @@ -23,6 +24,7 @@ export async function runCommand( const context: CommandContext = { rawArgs: opts.rawArgs, args: parsedArgs, + data: opts.data, cmd, }; diff --git a/src/types.ts b/src/types.ts index 13df918..85857bb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -64,6 +64,7 @@ export type CommandContext = { args: ParsedArgs; cmd: CommandDef; subCommand?: CommandDef; + data?: any; }; // ----- Utils -----