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

flag docs issue #115

Open
bartenra opened this issue Aug 18, 2021 · 2 comments
Open

flag docs issue #115

bartenra opened this issue Aug 18, 2021 · 2 comments

Comments

@bartenra
Copy link

bartenra commented Aug 18, 2021

Snippet from docs:

import { command, boolean, flag } from 'cmd-ts';

const myFlag = option({
  type: boolean,
  long: 'my-flag',
  short: 'f',
});

const cmd = command({
  name: 'my flag',
  args: { myFlag },
});

flag is unused. Also, the example is not type-correct:

Argument of type '{ name: string; args: { myFlag: any; }; }' is not assignable to parameter of type 'CommandConfig<{ myFlag: any; }, HandlerFunc<{ myFlag: any; }>>'.
  Property 'handler' is missing in type '{ name: string; args: { myFlag: any; }; }' but required in type 'CommandConfig<{ myFlag: any; }, HandlerFunc<{ myFlag: any; }>>'.ts(2345)
@riccardoFasan
Copy link

Hi, I noticed the same issue.

@dmshvetsov
Copy link

@Schniz hi, I believe that this page https://cmd-ts.vercel.app/parsers/flags.html or the whole docs site is out of sync with this repo /docs directory

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

3 participants