Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for the
--postcss
option in the new CLI (#4607)
* add tests for the --postcss option in the new CLI * add `oneOf` ability to the `arg()` functionality By default, `arg()` doesn't have a way to define multiple types. We want the possibility of using `--postcss` (Boolean) or `--postcss ./custom-path.js`. But by default this is not possible. This commit will allow us to do a few things, mainly: - Keep the same API using the `{ type: oneOf(String, Boolean), description: '...' }` - Keep the `--help` output similar What we did behind the scenes is make sure to put the non recognized flags in the `_` arguments list. This is possible by doing `permissive: true`. We then manually parse those and resolve the correct value. * ensure that we can use a custom `--postcss ./with-custom-path.js`
- Loading branch information
1 parent
b86aa5c
commit f4799a3
Showing
2 changed files
with
185 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters