feat(cli): 增强工作流子命令专属帮助与参数体验
- 注册 workflow webhook 子命令与别名 (webhook-send, webhooks) - 为 workflow node add 和 node edit 增加 --sleep-time 参数支持与针对性错误提示 - 为 workflow test 增加单号与流程ID输入颠倒时的自纠错能力与 Webhook 引导提示 - 在 help.ts 中增加 node add/edit、test 与 webhook 的多层级精准帮助 - 保持黑盒 CLI 使用体验,杜绝阅读源码定位工作流操作参数
This commit is contained in:
1 parent
d07336a1b0
commit
a0cb09b500
6 files changed
+230
-19
No files matched your search
+4
-2
@@ -93,9 +93,11 @@ function isVersionRequested(parsed: CliParsedArgs): boolean {
|
||||
|
||||
function resolveHelpTarget(parsed: CliParsedArgs): string[] {
|
||||
if (["help", "h", "?"].includes((parsed.area || "").toLowerCase())) {
|
||||
return [parsed.action, parsed.args[0]].filter((value): value is string => Boolean(value));
|
||||
return [parsed.action, parsed.args[0], parsed.args[1]].filter((value): value is string => Boolean(value));
|
||||
}
|
||||
return [parsed.area, parsed.action === "help" ? parsed.args[0] : parsed.action].filter((value): value is string => Boolean(value));
|
||||
const primaryAction = parsed.action === "help" ? parsed.args[0] : parsed.action;
|
||||
const subAction = parsed.action === "help" ? parsed.args[1] : parsed.args[0];
|
||||
return [parsed.area, primaryAction, subAction].filter((value): value is string => Boolean(value));
|
||||
}
|
||||
|
||||
async function dispatchCli(rawArgs: string[], options: CliRunOptions = {}): Promise<CliResult> {
|
||||
|
||||
Reference in new issue
Block a user