-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update commander to the latest version #138
Conversation
fd1b5f1
to
b8c67a9
Compare
1bfd2f9
to
3488273
Compare
3488273
to
f3f9d87
Compare
cli.js
Outdated
const chalk = require('chalk'); | ||
const { version } = require('./package.json'); | ||
const fusv = require('.'); | ||
|
||
commander | ||
program | ||
.usage('[options] <folders...>') | ||
.version(version, '-v, --version') | ||
.option('-i, --ignore <ignoredVars>', 'ignore variables, comma separated') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeoSot this still doesn't use the variadic option ...
https://github.com/tj/commander.js/#variadic-option
Wouldn't using this simplify things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to keep things the same as possible.
It can be done. Although the $
prefix in each var, will have to be escaped.
I propose to leave it as it is and we can change it in a next pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not our job to escape it, I think? I tested it with the default Windows cmd and it seems to work fine here.
C:\Users\xmr\Desktop\find-unused-sass-variables>npm run check -- --ignore $unused
> find-unused-sass-variables@3.1.0 check C:\Users\xmr\Desktop\find-unused-sass-variables
> node ./cli.js tests/ non-existent-folder/ -i "$a" "--ignore" "$unused"
Looking for unused variables
Finding unused variables in "C:\Users\xmr\Desktop\find-unused-sass-variables\tests"...
9 total variables.
6 are not used!
Variable $b is not being used!
Variable $black is not being used!
Variable $ignored-variable is not being used!
Variable $enabled-variable is not being used!
Variable $nestedVar is not being used!
Variable $nestNestedVar is not being used!
Finding unused variables in "C:\Users\xmr\Desktop\find-unused-sass-variables\non-existent-folder"...
"C:\Users\xmr\Desktop\find-unused-sass-variables\non-existent-folder": Not a valid directory!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in linux :/
> node ./cli.js tests/ non-existent-folder/ -i "$a" "--ignore" "$unused"
{ ignore: [ '', '' ] }
> node ./cli.js tests/ non-existent-folder/ -i '$a' --ignore '$unused' 'b'
{ ignore: [ '$a', '$unused', 'b' ] }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right, I'll revert the variadic change and we can tackle it along with the ''
in another PR :)
f3f9d87
to
a64c198
Compare
Also, refactor cli code a bit
317fe6c
to
5d1b8be
Compare
Refs #100
Closes #128 by superseding it