MatthiasMargot / typegen

Generate source-code types from a swagger-specification file
MIT License
1 stars 1 forks source link

Make it possible to write to stdout instead of to file-system #20

Closed MatthiasMargot closed 3 years ago

MatthiasMargot commented 3 years ago

Unfortunately, I can't make an argument conditionally optional in commander.

I wanted to do this:

Commander doesn't allow this, an argument is either optional or required, not conditionally so. I could throw a custom error but in that case, the auto-generated help message that says that pathToDestination is optional would not be correct, it wouldn't reflect the fact that it's optional only sometimes.

Therefore I went for an inversion of this API:

Unfortunately, this inverses the default behavior from file-system write to stdout write but we get the desired functionality and the help & documentation are consistent with the behavior.

Fixes #19

codecov[bot] commented 3 years ago

Codecov Report

Merging #20 (d4f919d) into master (45db1c4) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #20   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines           29        29           
  Branches         3         3           
=========================================
  Hits            29        29           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 45db1c4...d4f919d. Read the comment docs.