fix: 收敛受控 CLI 调用与诊断
This commit is contained in:
+5
-13
@@ -769,21 +769,13 @@ async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
if (top === "trans" || top === "tran") {
|
||||
const error = new Error(`${top} is a PATH wrapper, not a bun scripts/cli.ts subcommand`);
|
||||
Object.assign(error, {
|
||||
name: "TransEntrypointMigrationError",
|
||||
const replacement = `trans ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`;
|
||||
throw new CliInputError(`${top} is a PATH wrapper, not a bun scripts/cli.ts subcommand`, {
|
||||
code: "trans-root-cli-entrypoint-moved",
|
||||
level: "error",
|
||||
entrypoint: top,
|
||||
operation: "root-cli-dispatch",
|
||||
replacementExamples: {
|
||||
canonical: `trans ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`,
|
||||
legacyUnified: `bun scripts/cli.ts ssh ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`,
|
||||
},
|
||||
migrationHint: "Use: trans <route> <operation> [args...]. The PATH wrapper delegates to the lightweight SSH CLI.",
|
||||
note: "Ordinary root CLI commands continue to use bun scripts/cli.ts <command>.",
|
||||
argument: top,
|
||||
usage: replacement,
|
||||
hint: "Use trans <route> <operation> [args...]; ordinary root CLI commands continue to use bun scripts/cli.ts <command>.",
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
|
||||
throw new CliInputError(`Unknown command: ${commandName}`, {
|
||||
|
||||
Reference in New Issue
Block a user