fix: apply provider flag before startup banner (#322)

This commit is contained in:
Vasanth T
2026-04-04 11:49:02 +05:30
committed by GitHub
parent bd4daa3ee7
commit cdbe016e6f
3 changed files with 50 additions and 17 deletions

View File

@@ -35,6 +35,18 @@ export function parseProviderFlag(args: string[]): string | null {
return value
}
/**
* Parse and apply --provider from argv in one step.
* Returns undefined when the flag is absent.
*/
export function applyProviderFlagFromArgs(
args: string[],
): { error?: string } | undefined {
const provider = parseProviderFlag(args)
if (!provider) return undefined
return applyProviderFlag(provider, args)
}
/**
* Extract the value of --model from argv.
* Returns null if absent.