fix(cli): 收敛逐级披露与输入错误
This commit is contained in:
+7
-2
@@ -4,7 +4,7 @@
|
||||
import { readConfig } from "./src/config";
|
||||
import { debugDispatch, debugEgressProxy, debugHealth, debugProviderRootfs, debugSshPool, debugTask, isDebugDispatchCommand, type DebugDispatchCommand } from "./src/debug";
|
||||
import { isRebuildableService, isRestartableService, rebuildService, restartService, stackLogs, stackStatus, startStack, stopStack, unsupportedRebuildService, unsupportedRestartService } from "./src/docker";
|
||||
import { emitError, emitJson, emitText, isRenderedCliResult } from "./src/output";
|
||||
import { CliInputError, emitError, emitJson, emitText, isRenderedCliResult } from "./src/output";
|
||||
import { cancelJob, jobWithTail, listJobs, listJobsSummary, readJob, renderJobLaunchSummary, renderJobStatusSummary, runJob } from "./src/jobs";
|
||||
import { checkHelp, parseCheckOptions, runChecks, runRecoveryGuardrailsCheck } from "./src/check";
|
||||
import { runSsh } from "./src/ssh";
|
||||
@@ -786,7 +786,12 @@ async function main(): Promise<void> {
|
||||
throw error;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown command: ${commandName}`);
|
||||
throw new CliInputError(`Unknown command: ${commandName}`, {
|
||||
code: "unknown-command",
|
||||
argument: args[0] ?? "",
|
||||
usage: "bun scripts/cli.ts help",
|
||||
hint: "Run the top-level help, then use the matching namespace-scoped help before retrying.",
|
||||
});
|
||||
}
|
||||
|
||||
if (import.meta.main && !process.execArgv.includes("--check")) {
|
||||
|
||||
Reference in New Issue
Block a user