This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 6 files changed +35
-15
lines changed 6 files changed +35
-15
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const cli = yargs
29
29
default : ''
30
30
} )
31
31
. commandDir ( 'commands' )
32
+ . epilog ( utils . ipfsPathHelp )
32
33
. demandCommand ( 1 )
33
34
. fail ( ( msg , err , yargs ) => {
34
35
if ( err ) {
Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ module.exports = {
11
11
12
12
describe : 'Start a long-running daemon process' ,
13
13
14
- builder : {
15
- 'enable-sharding-experiment' : {
16
- type : 'boolean' ,
17
- default : false
18
- } ,
19
- 'enable-pubsub-experiment' : {
20
- type : 'boolean' ,
21
- default : false
22
- }
14
+ builder ( yargs ) {
15
+ return yargs
16
+ . epilog ( utils . ipfsPathHelp )
17
+ . option ( 'enable-sharding-experiment' , {
18
+ type : 'boolean' ,
19
+ default : false
20
+ } )
21
+ . option ( 'enable-pubsub-experiment' , {
22
+ type : 'boolean' ,
23
+ default : false
24
+ } )
23
25
} ,
24
26
25
27
handler ( argv ) {
Original file line number Diff line number Diff line change @@ -5,19 +5,14 @@ const IPFS = require('../../core')
5
5
const utils = require ( '../utils' )
6
6
const print = utils . print
7
7
8
- const ipfsPathHelp = 'ipfs uses a repository in the local file system. By default, the repo is ' +
9
- 'located at ~/.ipfs.\nTo change the repo location, set the $IPFS_PATH environment variable:\n\n' +
10
- '\texport IPFS_PATH=/path/to/ipfsrepo\n'
11
-
12
8
module . exports = {
13
9
command : 'init' ,
14
10
15
11
describe : 'Initialize a local IPFS node' ,
16
12
17
13
builder ( yargs ) {
18
- print ( ipfsPathHelp )
19
-
20
14
return yargs
15
+ . epilog ( utils . ipfsPathHelp )
21
16
. option ( 'bits' , {
22
17
type : 'number' ,
23
18
alias : 'b' ,
Original file line number Diff line number Diff line change @@ -111,3 +111,7 @@ exports.rightpad = (val, n) => {
111
111
}
112
112
return result
113
113
}
114
+
115
+ exports . ipfsPathHelp = 'ipfs uses a repository in the local file system. By default, the repo is ' +
116
+ 'located at ~/.jsipfs. To change the repo location, set the $IPFS_PATH environment variable:\n\n' +
117
+ 'export IPFS_PATH=/path/to/ipfsrepo\n'
Original file line number Diff line number Diff line change @@ -120,4 +120,13 @@ describe('daemon', () => {
120
120
done ( )
121
121
} )
122
122
} )
123
+
124
+ it ( 'should present ipfs path help when option help is received' , function ( done ) {
125
+ this . timeout ( 100 * 1000 )
126
+
127
+ ipfs ( 'daemon --help' ) . then ( ( res ) => {
128
+ expect ( res ) . to . have . string ( 'export IPFS_PATH=/path/to/ipfsrepo' )
129
+ done ( )
130
+ } )
131
+ } )
123
132
} )
Original file line number Diff line number Diff line change @@ -66,4 +66,13 @@ describe('init', function () {
66
66
expect ( repoExistsSync ( 'version' ) ) . to . equal ( true )
67
67
} )
68
68
} )
69
+
70
+ it ( 'should present ipfs path help when option help is received' , function ( done ) {
71
+ this . timeout ( 100 * 1000 )
72
+
73
+ ipfs ( 'init --help' ) . then ( ( res ) => {
74
+ expect ( res ) . to . have . string ( 'export IPFS_PATH=/path/to/ipfsrepo' )
75
+ done ( )
76
+ } )
77
+ } )
69
78
} )
You can’t perform that action at this time.
0 commit comments