Closed MatthiasMargot closed 3 years ago
Merging #20 (d4f919d) into master (45db1c4) will not change coverage. The diff coverage is
n/a
.
@@ 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.
Unfortunately, I can't make an argument conditionally optional in commander.
I wanted to do this:
pathToDestination
, is required when the flag-l, --log
is not provided-l, --log
is provided onlypathToSource
is required and the output is simply logged to the consoleCommander 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:
-o, --output
which takes thepathToDestination
pathToSource
requiredUnfortunately, 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