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

Add IPFS_PATH to CLI help #1213

Closed
vmx opened this issue Feb 12, 2018 · 7 comments
Closed

Add IPFS_PATH to CLI help #1213

vmx opened this issue Feb 12, 2018 · 7 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up

Comments

@vmx
Copy link
Member

vmx commented Feb 12, 2018

It's possible to init a repository at a different location (other than the default ~/.jsipfs) with setting the IPFS_PATH environment variable. This isn't clear from the CLI help. go-ipfs has this information:

ipfs uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
environment variable:

    export IPFS_PATH=/path/to/ipfsrepo

Add this to the js-ipfs CLI as well.

@vmx
Copy link
Member Author

vmx commented Feb 12, 2018

This isn't as easy as expected as it needs an change on the upstream argument parser package. See yargs/yargs#924 for more information.

@vmx vmx self-assigned this Feb 12, 2018
@daviddias daviddias added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue status/ready Ready to be worked P2 Medium: Good to have, but can wait until someone steps up labels Feb 19, 2018
@bvand
Copy link
Contributor

bvand commented Mar 20, 2018

@vmx I'm new to ipfs, looking to help out on an issue like this to get started.

It seems like the final comment in the yargs issue you have linked proposes using an epilog, but I believe you and @diasdavid are looking for a prologue?
I noticed another issue in yargs that also asked for some way to add a prologue: yargs/yargs#401. They suggest using either the .usage() method, or simply console.log...

I'd like to attempt the first option (.usage()) to solve this problem. Which of the cli commands' information would you like the IPFS_PATH help to be prepended to? Just the init command?
Am I missing anything here?

@bvand
Copy link
Contributor

bvand commented Mar 21, 2018

@vmx I created #1274, which just logs the help message before the yargs output. Are there any other commands the help message should happen for? e.g. should it show up when just running

jsipfs --help

on its own?

@vmx
Copy link
Member Author

vmx commented Mar 26, 2018

@bvand I think having it in init is enough. It also matches what go-ipfs is doing.

@vasco-santos
Copy link
Member

@vmx the go-ipfs also reports the IPFS_PATH usage on the help menu. Should we add it? Otherwise, this issue is accomplished, right?

@vmx
Copy link
Member Author

vmx commented Apr 9, 2018

@vasco-santos You are right, I've missed that IPFS_PATH is also shown on ipfs --help. It also shows up on ipfs daemon --help. I guess that ideally we display it whenever go-ipfs displays it (whenever that is).

@vasco-santos
Copy link
Member

Ok, I will add it then @vmx 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

4 participants