Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd-ts swallows an extra -- #220

Open
lgarron opened this issue Oct 28, 2024 · 0 comments
Open

cmd-ts swallows an extra -- #220

lgarron opened this issue Oct 28, 2024 · 0 comments

Comments

@lgarron
Copy link

lgarron commented Oct 28, 2024

  1. Create a program that takes a string as a positional argument (e.g. the one below).
  2. Run command -- --

Expected: The program receives -- as the string for the positional arg.
Observed: The program swallows an extra --. You have to call command -- -- -- to get -- as the positional arg.

Example program:

import { binary, string as cmdString, command, positional, run } from "cmd-ts";

const app = command({
  name: "my-command",
  args: {
    text: positional({ type: cmdString, displayName: "Text" }),
  },
  handler: async ({ text }) => {
    console.log(text);
  },
});

run(binary(app), process.argv);
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

No branches or pull requests

1 participant