fabien0102 / ts-to-zod

Generate zod schemas from typescript types/interfaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`--help` flag doesn't work

ppyrzanowski opened this issue · comments

Bug description

The flag option seems to be defined in the cli.ts file, but somehow I'm not able to execute with flag --help, -h nor plain h.
I have installed ts-to-zod with pnpm, pnpm add -D ts-to-zod.

Input

ppyrz@DESKTOP-GDDHMQI MINGW64 ~/Dev/Projects/anyAssetClient (main)
$ pnpm exec ts-to-zod
 »   Error: Missing 1 required arg:
 »   input file (typescript)
 »   See more help with --help

ppyrz@DESKTOP-GDDHMQI MINGW64 ~/Dev/Projects/anyAssetClient (main)
$ pnpm exec ts-to-zod --help
 »   Error: Parsing --help 
 »      Command tstozod not found.
 »   See more help with --help

ppyrz@DESKTOP-GDDHMQI MINGW64 ~/Dev/Repos/ts-to-zod (main)
$ ./bin/run --help
 »   Error: Parsing --help 
 »      Command tstozod not found.
 »   See more help with --help

ppyrz@DESKTOP-GDDHMQI MINGW64 ~/Dev/Repos/ts-to-zod (main)
$ ./bin/run --config example
✔ Validating generated types
🎉 Zod schemas generated!

Expected output

A list of flag options available to the CLI, was looking for a way to avoid a config file at root level and instead specify my config path as a flag in a package.json script

Actual output

$ ./node_modules/.bin/ts-to-zod --help
 »   Error: Parsing --help 
 »      Command tstozod not found.
 »   See more help with --help

Versions
Windows 11, tested with cmd and git bash.

  • tsc: 4.8.4
  • Zod: 3.6.0
  • pnpm 8.14.1

duplicate of #196