Skip to content

Commit

Permalink
fix(cli): skip undefined options
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Apr 3, 2024
1 parent 49c123f commit a7bf95e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rich-wasps-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@datatruck/cli": patch
---

Fix cli options
3 changes: 2 additions & 1 deletion packages/cli/src/utils/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export function createCommand<T extends OptionsConfig>(
const parse =
typeof option.value === "string" ? parsers[option.value] : undefined;
const cliValue = cliOptions[option.flag ?? name] ?? option.defaults;
commandOptions[name] = parse ? parse(cliValue) : cliValue;
if (cliValue !== undefined)
commandOptions[name] = parse ? parse(cliValue) : cliValue;
}
}
const options = argumentOptions.reduce((result, inlineOption, index) => {
Expand Down

0 comments on commit a7bf95e

Please sign in to comment.