Skip to content

add a config to allow parsing options after command method#2

Open
g9wp wants to merge 3 commits intojersou:mainfrom
g9wp:optAfterMethodCmd
Open

add a config to allow parsing options after command method#2
g9wp wants to merge 3 commits intojersou:mainfrom
g9wp:optAfterMethodCmd

Conversation

@g9wp
Copy link
Contributor

@g9wp g9wp commented Dec 11, 2025

add a config to allow parsing options after command method

Deno.test("testOptionAfterMethodCmd", () => {
  const result = cliteParse(Tool, {
    args: ["down", "--opt3=xclkd", "true", "foo"],
  });
  assertEquals(result.command, "down");
  assertEquals(result.obj.opt3, "xclkd");
  assertEquals(result.commandArgs, [true, "foo"]);

  const result2 = cliteParse(Tool, {
    args: ["down", "--opt3=xclkd", "true", "foo"],
    dontParseOptionAfterMethodCmd: true,
  });
  assertEquals(result2.command, "down");
  assertEquals(result2.obj.opt3, "azer");
  assertEquals(result2.commandArgs, ["--opt3=xclkd", true, "foo"]);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant