antoine-coulon / skott

All-in-one devtool to automatically analyze, search and visualize project modules and dependencies from JavaScript, TypeScript (JSX/TSX) and Node.js (ES6, CommonJS)
MIT License
669 stars 25 forks source link

Restore behavior where we can provide falsy values to boolean options with the CLI #101

Closed antoine-coulon closed 1 year ago

antoine-coulon commented 1 year ago

Regression of the CLI introduced in #88

Previously with sade, we were able to provide to boolean options both truthy and falsy values:

skott --trackTypeOnlyDependencies=false # works
skott --trackTypeOnlyDependencies=true # works

Using commander, that behavior is no longer supported

skott --trackTypeOnlyDependencies=false # does not work

When the option default value is "false" that's fine. But when the default value is "true" that's problematic. For instance trackTypeOnlyDependencies is one option whose default value is "true".


skott --trackTypeOnlyDependencies # we can only enable it, even though its default value is already true
```ou 

With commander it seems that you can bypass that behavior using `--no-<command-name>` allowing you to provide falsy values.