ohm icon indicating copy to clipboard operation
ohm copied to clipboard

ohm-js cli : add --output argument to define the output folder

Open stondini opened this issue 3 years ago • 2 comments

Hello,

It may be useful for Typescript developers to have the ability to generate the Javascript + Typescript definition files in a specific folder in order to avoid them in src folder (which is the current output folder).

For instance, the following command generates the files at the same place as the ohm grammar source files. ohm generateBundles --withTypes src/ohm/*.ohm

It could be great to have an additional argument to specify the output folder: ohm generateBundles --withTypes src/ohm/*.ohm --output dist/ohm

What do you think ?

Thank you. Stephane

stondini avatar Jul 06 '22 11:07 stondini

Agreed! My instinct would be to make this behave the same way as TypeScript's outDir arg, and preserve the directory structure of the original files. Does this seem like the right choice?

pdubroy avatar Jul 08 '22 19:07 pdubroy

Yes it sounds good. It could be the default behaviour and stil keep --output argument to override it in case of special situations.

stondini avatar Jul 09 '22 08:07 stondini