@@ -478,7 +478,7 @@ function processCommandExecution<TCommand extends CommandDefinition<any, any>>(
478478export function processConfig < TCommands extends Record < string , CommandDefinition < any , any > > = { } > (
479479 config : DefineConfig < TCommands > ,
480480 args : string [ ] ,
481- ) : ProcessResult < TCommands [ keyof TCommands ] > {
481+ ) : ProcessResult < CommandDefinition < any , any > > {
482482 const parsedFlags = parseFlags ( args ) ;
483483 const commandArgs = ( parsedFlags . _ as string [ ] ) || [ ] ;
484484
@@ -496,9 +496,7 @@ export function processConfig<TCommands extends Record<string, CommandDefinition
496496 process . exit ( 0 ) ;
497497 } else if ( config . defaultCommand ) {
498498 // Use default command when no command is specified
499- return processCommandExecution ( config . defaultCommand , parsedFlags , commandArgs ) as ProcessResult <
500- TCommands [ keyof TCommands ]
501- > ;
499+ return processCommandExecution ( config . defaultCommand , parsedFlags , commandArgs ) ;
502500 } else {
503501 // Show help and throw error
504502 displayHelp ( config . commands , config . meta ) ;
@@ -521,7 +519,7 @@ export function processConfig<TCommands extends Record<string, CommandDefinition
521519 }
522520
523521 // Process the command
524- return processCommandExecution ( command , parsedFlags , remainingArgs ) as ProcessResult < TCommands [ keyof TCommands ] > ;
522+ return processCommandExecution ( command , parsedFlags , remainingArgs ) ;
525523}
526524
527525// Export main functions and types from config
0 commit comments