-
Notifications
You must be signed in to change notification settings - Fork 145
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
feat: add --version option #66
Conversation
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.
Thank you 🎉
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.
@GantMan Had a doubt while rechecking and noticing promptForCommand
being hijacked.
I think this could be done in a nicer way, see comments ;)
cli.js
Outdated
alias: 'v', | ||
desc: 'Print installed version', | ||
type: 'string' | ||
}) | ||
.default('contributors', []) |
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.
This doesn't seem to be the standard way to display version information using yargs:
https://github.com/yargs/yargs/blob/master/docs/api.md#version
Reading the docs, I think that this should be enough:
.alias('v', 'version')
.version()
Also, could you move this block right under alias('h', 'help')
? It would make more sense ;)
cli.js
Outdated
console.log(require('./package.json').version); | ||
process.exit(0); | ||
} | ||
|
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.
Shouldn't be needed anymore
@machour - you're right! I'm not sure how I missed that! updated 👍 |
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.
No worries @GantMan :)
Just a final thing to take care of and this baby can be merged in
cli.js
Outdated
@@ -29,6 +29,8 @@ var argv = yargs | |||
.boolean('commit') | |||
.default('files', ['README.md']) | |||
.default('contributorsPerLine', 7) | |||
.alias('v', 'version') | |||
.version() |
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.
now if we can have these two lines moved up under help, it would be amazing 😅
👍 @machour |
Thank you so much for baring with me matey! |
Quality over quantity any day! |
closes #65