fix: apply provider flag before startup banner (#322)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user