From f5ded7c4007187497f894149e920b0e7f2df44b3 Mon Sep 17 00:00:00 2001 From: Brian Vander Schaaf Date: Wed, 21 Mar 2018 14:00:09 -0400 Subject: [PATCH] cli: add IPFS_PATH info to init command help License: MIT Signed-off-by: Brian Vander Schaaf --- src/cli/commands/init.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/cli/commands/init.js b/src/cli/commands/init.js index 741a313750..920519f90c 100644 --- a/src/cli/commands/init.js +++ b/src/cli/commands/init.js @@ -5,23 +5,30 @@ const IPFS = require('../../core') const utils = require('../utils') const print = utils.print +const ipfsPathHelp = 'ipfs uses a repository in the local file system. By default, the repo is ' + + 'located at ~/.ipfs.\nTo change the repo location, set the $IPFS_PATH environment variable:\n\n' + + '\texport IPFS_PATH=/path/to/ipfsrepo\n' + module.exports = { command: 'init', describe: 'Initialize a local IPFS node', - builder: { - bits: { - type: 'number', - alias: 'b', - default: '2048', - describe: 'Number of bits to use in the generated RSA private key (defaults to 2048)' - }, - emptyRepo: { - alias: 'e', - type: 'boolean', - describe: "Don't add and pin help files to the local storage" - } + builder (yargs) { + print(ipfsPathHelp) + + return yargs + .option('bits', { + type: 'number', + alias: 'b', + default: '2048', + describe: 'Number of bits to use in the generated RSA private key (defaults to 2048)' + }) + .option('emptyRepo', { + alias: 'e', + type: 'boolean', + describe: "Don't add and pin help files to the local storage" + }) }, handler (argv) {