mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 20:20:43 +00:00
fix(cli): fast-path bare channels help (#77659)
* fix(cli): fast-path bare channels help * fix(cli): normalize channels add argv gating * fix(cli): restore channel add completion flags
This commit is contained in:
@@ -3,6 +3,7 @@ import { repoInstallSpec } from "openclaw/plugin-sdk/test-fixtures";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { loggingState } from "../../logging/state.js";
|
||||
import { setCommandJsonMode } from "./json-mode.js";
|
||||
import { applyParentDefaultHelpAction } from "./parent-default-help.js";
|
||||
|
||||
const DISCORD_REPO_INSTALL_SPEC = repoInstallSpec("discord");
|
||||
|
||||
@@ -149,6 +150,7 @@ describe("registerPreActionHooks", () => {
|
||||
.command("send")
|
||||
.option("--json")
|
||||
.action(() => {});
|
||||
applyParentDefaultHelpAction(channels);
|
||||
program
|
||||
.command("plugins")
|
||||
.command("install")
|
||||
@@ -289,6 +291,18 @@ describe("registerPreActionHooks", () => {
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("skips startup bootstrap for parent default help actions", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["channels"],
|
||||
processArgv: ["node", "openclaw", "channels"],
|
||||
});
|
||||
|
||||
expect(emitCliBannerMock).not.toHaveBeenCalled();
|
||||
expect(setVerboseMock).not.toHaveBeenCalled();
|
||||
expect(ensureConfigReadyMock).not.toHaveBeenCalled();
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("lets configure own config validation and plugin loading", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["configure"],
|
||||
|
||||
Reference in New Issue
Block a user