Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit ed3f719

Browse files
committed
Enables stdin->process.argv only on selected commands
1 parent 242b165 commit ed3f719

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"peer-book": "~0.3.1",
129129
"peer-id": "~0.8.2",
130130
"peer-info": "~0.8.3",
131-
"pipe-args": "^1.0.1",
131+
"pipe-args": "^1.2.0",
132132
"promisify-es6": "^1.0.2",
133133
"pull-file": "^1.0.0",
134134
"pull-paramap": "^1.2.1",

src/cli/bin.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
'use strict'
44

5-
require('pipe-args').load()
6-
const yargs = require('yargs')
5+
const pipe = require('pipe-args')
76
const updateNotifier = require('update-notifier')
87
const readPkgUp = require('read-pkg-up')
98

9+
const enableStdin = [
10+
'files', 'path', 'object data', 'ref', 'domain-name', 'key', 'ipfs-path',
11+
'name', 'address', 'data', 'peer', 'recursive', 'default-config', 'peer ID'
12+
]
13+
14+
pipe.load({ commands: enableStdin })
15+
16+
const yargs = require('yargs')
17+
1018
const pkg = readPkgUp.sync({cwd: __dirname}).pkg
1119
updateNotifier({
1220
pkg,

0 commit comments

Comments
 (0)