mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-16 18:34:18 +00:00
fix(cli): keep plugin help registration reachable
This commit is contained in:
@@ -353,7 +353,7 @@ describe("channel-auth", () => {
|
||||
});
|
||||
|
||||
await expect(runChannelLogin({ channel: "whatsapp" }, runtime)).rejects.toThrow(
|
||||
'Channel "whatsapp" does not support login. Run `openclaw channels status --channel whatsapp` to inspect supported actions.',
|
||||
'Channel "whatsapp" does not support login. Run openclaw channels status --channel whatsapp to inspect supported actions.',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -564,7 +564,7 @@ describe("channel-auth", () => {
|
||||
});
|
||||
|
||||
await expect(runChannelLogout({ channel: "whatsapp" }, runtime)).rejects.toThrow(
|
||||
'Channel "whatsapp" does not support logout. Run `openclaw channels status --channel whatsapp` to inspect supported actions.',
|
||||
'Channel "whatsapp" does not support logout. Run openclaw channels status --channel whatsapp to inspect supported actions.',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,15 +18,15 @@ export function shouldSkipPluginCommandRegistration(params: {
|
||||
hasBuiltinPrimary: boolean;
|
||||
}): boolean {
|
||||
const invocation = resolveCliArgvInvocation(params.argv);
|
||||
if (params.primary === "help") {
|
||||
return invocation.hasHelpOrVersion && invocation.commandPath.length <= 1;
|
||||
}
|
||||
if (invocation.hasHelpOrVersion) {
|
||||
return true;
|
||||
}
|
||||
if (params.hasBuiltinPrimary) {
|
||||
return true;
|
||||
}
|
||||
if (params.primary === "help") {
|
||||
return invocation.hasHelpOrVersion && invocation.commandPath.length <= 1;
|
||||
}
|
||||
if (!params.primary) {
|
||||
return invocation.hasHelpOrVersion;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ describe("plugins cli policy mutations", () => {
|
||||
);
|
||||
|
||||
expect(runtimeErrors).toContain(
|
||||
"Plugin not found: missing-plugin. Run `openclaw plugins list` to see installed plugins, or `openclaw plugins search missing-plugin` to look for installable plugins.",
|
||||
"Plugin not found: missing-plugin. Run openclaw plugins list to see installed plugins, or openclaw plugins search missing-plugin to look for installable plugins.",
|
||||
);
|
||||
expect(enablePluginInConfig).not.toHaveBeenCalled();
|
||||
expect(writeConfigFile).not.toHaveBeenCalled();
|
||||
|
||||
Reference in New Issue
Block a user