Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/yargs/index.js')
-rw-r--r--node_modules/yargs/index.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/node_modules/yargs/index.js b/node_modules/yargs/index.js
index dfed54bc5..2db543ed3 100644
--- a/node_modules/yargs/index.js
+++ b/node_modules/yargs/index.js
@@ -25,8 +25,15 @@ function singletonify (inst) {
Object.keys(inst).forEach((key) => {
if (key === 'argv') {
Argv.__defineGetter__(key, inst.__lookupGetter__(key))
+ } else if (typeof inst[key] === 'function') {
+ Argv[key] = inst[key].bind(inst)
} else {
- Argv[key] = typeof inst[key] === 'function' ? inst[key].bind(inst) : inst[key]
+ Argv.__defineGetter__('$0', () => {
+ return inst.$0
+ })
+ Argv.__defineGetter__('parsed', () => {
+ return inst.parsed
+ })
}
})
}