chore: 更新版本号至 0.1.3,并升级 @opencode-ai/plugin 和 nanoid 依赖,增强命令行参数解析功能

This commit is contained in:
xiongxiao
2026-03-17 20:46:13 +08:00
committed by cnb
parent 151586f98c
commit 648fe7ad33
2 changed files with 11 additions and 7 deletions

View File

@@ -124,9 +124,10 @@ export const parse = async (opts: {
token?: string,
username?: string,
id?: string,
}
},
exitOnEnd?: boolean,
}) => {
const { description, parse = true, version } = opts;
const { description, parse = true, version, exitOnEnd = true } = opts;
const app = opts.app as App;
const _program = opts.program || program;
_program.description(description || 'Router 命令行工具');
@@ -167,9 +168,12 @@ export const parse = async (opts: {
remoteApp.listenProxy();
console.log('已连接到远程应用,正在监听命令...');
}
return
return;
}
if (parse) {
_program.parse(process.argv);
await _program.parseAsync(process.argv);
if (exitOnEnd) {
process.exit(0);
}
}
}