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: Allow setting scriptName $0 #1143
Conversation
bump! |
@bcoe this PR even has documentation 🙈 |
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.
Sorry for the delay, Ben has been travelling abroad.
yargs.js
Outdated
@@ -37,6 +37,11 @@ function Yargs (processArgs, cwd, parentRequire) { | |||
|
|||
if (!cwd) cwd = process.cwd() | |||
|
|||
self.scriptName = function scriptName ($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.
No reason we can't use an intelligible parameter name here
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.
Saw it being used throughout (like #L899) so just went with it, but yeah I agree, shall change it to scriptName
f5bfc82
to
17108d9
Compare
👋 hey, still haven't had a chance to sit down and grind through any OSS, we're having an all hands all week at npm, Inc. But, will hopefully land some tickets this weekend. |
@laggingreflex @axe312ger love it 👍 |
@laggingreflex |
This Pull Request updates dependency [yargs](https://github.com/yargs/yargs) from `^11.0.0` to `^12.0.0` <details> <summary>Release Notes</summary> ### [`v12.0.1`](https://github.com/yargs/yargs/blob/master/CHANGELOG.md#​1201httpsgithubcomyargsyargscomparev1200v1201-2018-06-29) [Compare Source](yargs/yargs@v12.0.0...v12.0.1) #### [12.0.1](yargs/yargs@v12.0.0...v12.0.1) (2018-06-29) --- ### [`v12.0.0`](https://github.com/yargs/yargs/blob/master/CHANGELOG.md#​1200httpsgithubcomyargsyargscomparev1110v1200-2018-06-26) [Compare Source](yargs/yargs@v11.1.0...v12.0.0) ##### Bug Fixes * .argv and .parse() now invoke identical code path ([#​1126](`yargs/yargs#1126)) ([f13ebf4](yargs/yargs@f13ebf4)) * remove the trailing white spaces from the help output ([#​1090](`yargs/yargs#1090)) ([3f0746c](yargs/yargs@3f0746c)) * **completion:** Avoid default command and recommendations during completion ([#​1123](`yargs/yargs#1123)) ([036e7c5](yargs/yargs@036e7c5)) ##### Chores * test Node.js 6, 8 and 10 ([#​1160](`yargs/yargs#1160)) ([84f9d2b](yargs/yargs@84f9d2b)) * upgrade to version of yargs-parser that does not populate value for unset boolean ([#​1104](`yargs/yargs#1104)) ([d4705f4](yargs/yargs@d4705f4)) ##### Features * add support for global middleware, useful for shared tasks like metrics ([#​1119](`yargs/yargs#1119)) ([9d71ac7](yargs/yargs@9d71ac7)) * allow setting scriptName $0 ([#​1143](`yargs/yargs#1143)) ([a2f2eae](yargs/yargs@a2f2eae)) * remove `setPlaceholderKeys` ([#​1105](`yargs/yargs#1105)) ([6ee2c82](yargs/yargs@6ee2c82)) ##### BREAKING CHANGES * Options absent from `argv` (not set via CLI argument) are now absent from the parsed result object rather than being set with `undefined` * drop Node 4 from testing matrix, such that we'll gradually start drifting away from supporting Node 4. * yargs-parser does not populate 'false' when boolean flag is not passed * tests that assert against help output will need to be updated --- </details> --- This PR has been generated by [Renovate Bot](https://renovatebot.com).
Fixes #1010 #1048 #1065