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

Commit 05ed837

Browse files
author
Alan Shaw
committed
fix: help
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
1 parent b16fc3f commit 05ed837

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/cli/bin.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'use strict'
44

55
const YargsPromise = require('yargs-promise')
6-
const yargs = require('yargs')
6+
const yargs = require('yargs/yargs')
77
const updateNotifier = require('update-notifier')
88
const utils = require('./utils')
99
const print = utils.print
@@ -15,7 +15,7 @@ async function main (args) {
1515
const oneWeek = 1000 * 60 * 60 * 24 * 7
1616
updateNotifier({ pkg, updateCheckInterval: oneWeek }).notify()
1717

18-
const cli = yargs
18+
const cli = yargs(args)
1919
.option('silent', {
2020
desc: 'Write no output',
2121
type: 'boolean',
@@ -44,11 +44,8 @@ async function main (args) {
4444
yargs.showHelp()
4545
})
4646

47-
// Parse and retrieve argv from yargs before command handlers are added
48-
const { argv } = yargs
49-
5047
// Function to get hold of a singleton ipfs instance
51-
const getIpfs = utils.singleton(cb => utils.getIPFS(argv, cb))
48+
const getIpfs = utils.singleton(cb => utils.getIPFS(yargs(args).argv, cb))
5249

5350
// add MFS (Files API) commands
5451
mfs(cli)

0 commit comments

Comments
 (0)