mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 01:40:42 +00:00
fix: align docs with cli and provider surfaces
This commit is contained in:
@@ -29,6 +29,15 @@ describe("command-tree", () => {
|
||||
expect(program.commands.map((command) => command.name())).toEqual(["beta"]);
|
||||
});
|
||||
|
||||
it("removes by command alias", () => {
|
||||
const program = new Command();
|
||||
program.command("alpha").alias("a");
|
||||
program.command("beta");
|
||||
|
||||
expect(removeCommandByName(program, "a")).toBe(true);
|
||||
expect(program.commands.map((command) => command.name())).toEqual(["beta"]);
|
||||
});
|
||||
|
||||
it("returns false when name does not exist", () => {
|
||||
const program = new Command();
|
||||
program.command("alpha");
|
||||
|
||||
@@ -11,7 +11,9 @@ export function removeCommand(program: Command, command: Command): boolean {
|
||||
}
|
||||
|
||||
export function removeCommandByName(program: Command, name: string): boolean {
|
||||
const existing = program.commands.find((command) => command.name() === name);
|
||||
const existing = program.commands.find(
|
||||
(command) => command.name() === name || command.aliases().includes(name),
|
||||
);
|
||||
if (!existing) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ const subCliCommandCatalog = defineCommandDescriptorCatalog([
|
||||
},
|
||||
{
|
||||
name: "plugins",
|
||||
description: "Manage OpenClaw plugins and extensions",
|
||||
description: "Manage OpenClaw plugins",
|
||||
hasSubcommands: true,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user