From e189b72983e5a6d8f579e16d1234e594dbe4fcb4 Mon Sep 17 00:00:00 2001 From: Brian Vander Schaaf Date: Sun, 1 Apr 2018 08:24:32 +0900 Subject: [PATCH] feat: cli: add IPFS_PATH info to init command help (#1274) 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) {