Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
2b8ef917
Commit
2b8ef917
authored
Nov 08, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ipfs2: Added descriptions for 'init', 'tour'
parent
c2615d34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
28 deletions
+25
-28
cmd/ipfs2/init.go
cmd/ipfs2/init.go
+12
-9
cmd/ipfs2/tour.go
cmd/ipfs2/tour.go
+13
-19
No files found.
cmd/ipfs2/init.go
View file @
2b8ef917
...
@@ -16,17 +16,20 @@ import (
...
@@ -16,17 +16,20 @@ import (
)
)
var
initCmd
=
&
cmds
.
Command
{
var
initCmd
=
&
cmds
.
Command
{
Description
:
"Initializes IPFS config file"
,
Help
:
`Initializes IPFS configuration files and generates a new keypair.
`
,
Options
:
[]
cmds
.
Option
{
Options
:
[]
cmds
.
Option
{
cmds
.
Option
{[]
string
{
"bits"
,
"b"
},
cmds
.
Int
},
cmds
.
Option
{[]
string
{
"bits"
,
"b"
},
cmds
.
Int
,
cmds
.
Option
{[]
string
{
"passphrase"
,
"p"
},
cmds
.
String
},
"Number of bits to use in the generated RSA private key (defaults to 4096)"
},
cmds
.
Option
{[]
string
{
"force"
,
"f"
},
cmds
.
Bool
},
cmds
.
Option
{[]
string
{
"passphrase"
,
"p"
},
cmds
.
String
,
cmds
.
Option
{[]
string
{
"datastore"
,
"d"
},
cmds
.
String
},
"Passphrase for encrypting the private key"
},
cmds
.
Option
{[]
string
{
"force"
,
"f"
},
cmds
.
Bool
,
"Overwrite existing config (if it exists)"
},
cmds
.
Option
{[]
string
{
"datastore"
,
"d"
},
cmds
.
String
,
"Location for the IPFS data store"
},
},
},
Help
:
`ipfs init
Initializes ipfs configuration files and generates a
new keypair.
`
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
arg
,
found
:=
req
.
Option
(
"d"
)
arg
,
found
:=
req
.
Option
(
"d"
)
...
...
cmd/ipfs2/tour.go
View file @
2b8ef917
...
@@ -13,27 +13,18 @@ import (
...
@@ -13,27 +13,18 @@ import (
)
)
var
cmdTour
=
&
cmds
.
Command
{
var
cmdTour
=
&
cmds
.
Command
{
Description
:
"An introduction to IPFS"
,
Arguments
:
[]
cmds
.
Argument
{
Help
:
`This is a tour that takes you through various IPFS concepts,
cmds
.
Argument
{
"number"
,
cmds
.
ArgString
,
false
,
false
},
},
// TODO UsageLine: "tour [<number>]",
// TODO Short: "Take the IPFS Tour.",
Help
:
`ipfs tour - Take the IPFS Tour.
ipfs tour [<number>] - Show tour topic. Default to current.
ipfs tour next - Show the next tour topic.
ipfs tour list - Show a list of topics.
ipfs tour restart - Restart the tour.
This is a tour that takes you through various IPFS concepts,
features, and tools to make sure you get up to speed with
features, and tools to make sure you get up to speed with
IPFS very quickly. To start, run:
IPFS very quickly. To start, run:
ipfs tour
ipfs tour
`
,
`
,
Arguments
:
[]
cmds
.
Argument
{
cmds
.
Argument
{
"number"
,
cmds
.
ArgString
,
false
,
false
,
"The number of the topic you would like to tour"
},
},
Subcommands
:
map
[
string
]
*
cmds
.
Command
{
Subcommands
:
map
[
string
]
*
cmds
.
Command
{
"list"
:
cmdIpfsTourList
,
"list"
:
cmdIpfsTourList
,
"next"
:
cmdIpfsTourNext
,
"next"
:
cmdIpfsTourNext
,
...
@@ -65,7 +56,8 @@ IPFS very quickly. To start, run:
...
@@ -65,7 +56,8 @@ IPFS very quickly. To start, run:
}
}
var
cmdIpfsTourNext
=
&
cmds
.
Command
{
var
cmdIpfsTourNext
=
&
cmds
.
Command
{
Help
:
"Show the next IPFS Tour topic."
,
Description
:
"Show the next IPFS Tour topic"
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
var
w
bytes
.
Buffer
var
w
bytes
.
Buffer
cfg
:=
req
.
Context
()
.
Config
cfg
:=
req
.
Context
()
.
Config
...
@@ -92,7 +84,8 @@ var cmdIpfsTourNext = &cmds.Command{
...
@@ -92,7 +84,8 @@ var cmdIpfsTourNext = &cmds.Command{
}
}
var
cmdIpfsTourRestart
=
&
cmds
.
Command
{
var
cmdIpfsTourRestart
=
&
cmds
.
Command
{
Help
:
"Restart the IPFS Tour."
,
Description
:
"Restart the IPFS Tour"
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
path
:=
req
.
Context
()
.
ConfigRoot
path
:=
req
.
Context
()
.
ConfigRoot
cfg
:=
req
.
Context
()
.
Config
cfg
:=
req
.
Context
()
.
Config
...
@@ -106,7 +99,8 @@ var cmdIpfsTourRestart = &cmds.Command{
...
@@ -106,7 +99,8 @@ var cmdIpfsTourRestart = &cmds.Command{
}
}
var
cmdIpfsTourList
=
&
cmds
.
Command
{
var
cmdIpfsTourList
=
&
cmds
.
Command
{
Help
:
"Show a list of IPFS Tour topics."
,
Description
:
"Show a list of IPFS Tour topics"
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
var
w
bytes
.
Buffer
var
w
bytes
.
Buffer
tourListCmd
(
&
w
,
req
.
Context
()
.
Config
)
tourListCmd
(
&
w
,
req
.
Context
()
.
Config
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment