mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
refactor: async-ify yargs (#236)
This commit is contained in:
parent
339d598295
commit
b27aae26c8
2 changed files with 6 additions and 6 deletions
|
|
@ -23,8 +23,8 @@ interface CliArgs {
|
|||
full_context: boolean | undefined;
|
||||
}
|
||||
|
||||
function parseArguments(): CliArgs {
|
||||
const argv = yargs(hideBin(process.argv))
|
||||
async function parseArguments(): Promise<CliArgs> {
|
||||
const argv = await yargs(hideBin(process.argv))
|
||||
.option('model', {
|
||||
alias: 'm',
|
||||
type: 'string',
|
||||
|
|
@ -53,11 +53,11 @@ function parseArguments(): CliArgs {
|
|||
.help()
|
||||
.alias('h', 'help')
|
||||
.strict().argv;
|
||||
return argv as unknown as CliArgs;
|
||||
return argv;
|
||||
}
|
||||
|
||||
// Renamed function for clarity
|
||||
export function loadCliConfig(): Config {
|
||||
export async function loadCliConfig(): Promise<Config> {
|
||||
// Load .env file using logic from server package
|
||||
loadEnvironment();
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ export function loadCliConfig(): Config {
|
|||
}
|
||||
|
||||
// Parse CLI arguments
|
||||
const argv = parseArguments();
|
||||
const argv = await parseArguments();
|
||||
|
||||
// Create config using factory from server package
|
||||
return createServerConfig(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue