Skip to content

Commit 4a6bc5e

Browse files
committed
fix(cli): preserve lazy runtime loading for help
1 parent b5b874e commit 4a6bc5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/cli/cli-utils.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Shared CLI execution wrappers and inherited Commander option lookup.
22
import type { Command } from "commander";
33
import { formatErrorMessage } from "../infra/errors.js";
4-
import { ExitError } from "../runtime.js";
54
import { formatCliOperatorError, isExpectedCliError } from "./failure-output.js";
65
import { isJsonOutputModeActive } from "./json-output-mode.js";
76

@@ -43,7 +42,8 @@ export async function runCommandWithRuntime(
4342
try {
4443
await action();
4544
} catch (err) {
46-
// Completed commands unwind to the outer cleanup and output-drain owner.
45+
// Keep help imports lazy while completed commands reach the cleanup and output-drain owner.
46+
const { ExitError } = await import("../runtime.js");
4747
if (
4848
err instanceof ExitError ||
4949
isJsonOutputModeActive(process.argv) ||

0 commit comments

Comments
 (0)