mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 02:30:39 +08:00
cmd/ipfs2: Added descriptions for 'init', 'tour'
This commit is contained in:

committed by
Juan Batiz-Benet

parent
c2615d3481
commit
2b8ef917b8
@ -16,17 +16,20 @@ import (
|
||||
)
|
||||
|
||||
var initCmd = &cmds.Command{
|
||||
Options: []cmds.Option{
|
||||
cmds.Option{[]string{"bits", "b"}, cmds.Int},
|
||||
cmds.Option{[]string{"passphrase", "p"}, cmds.String},
|
||||
cmds.Option{[]string{"force", "f"}, cmds.Bool},
|
||||
cmds.Option{[]string{"datastore", "d"}, cmds.String},
|
||||
},
|
||||
Help: `ipfs init
|
||||
Description: "Initializes IPFS config file",
|
||||
Help: `Initializes IPFS configuration files and generates a new keypair.
|
||||
`,
|
||||
|
||||
Initializes ipfs configuration files and generates a
|
||||
new keypair.
|
||||
`,
|
||||
Options: []cmds.Option{
|
||||
cmds.Option{[]string{"bits", "b"}, cmds.Int,
|
||||
"Number of bits to use in the generated RSA private key (defaults to 4096)"},
|
||||
cmds.Option{[]string{"passphrase", "p"}, 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"},
|
||||
},
|
||||
Run: func(res cmds.Response, req cmds.Request) {
|
||||
|
||||
arg, found := req.Option("d")
|
||||
|
@ -13,27 +13,18 @@ import (
|
||||
)
|
||||
|
||||
var cmdTour = &cmds.Command{
|
||||
|
||||
Arguments: []cmds.Argument{
|
||||
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,
|
||||
Description: "An introduction to IPFS",
|
||||
Help: `This is a tour that takes you through various IPFS concepts,
|
||||
features, and tools to make sure you get up to speed with
|
||||
IPFS very quickly. To start, run:
|
||||
|
||||
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{
|
||||
"list": cmdIpfsTourList,
|
||||
"next": cmdIpfsTourNext,
|
||||
@ -65,7 +56,8 @@ IPFS very quickly. To start, run:
|
||||
}
|
||||
|
||||
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) {
|
||||
var w bytes.Buffer
|
||||
cfg := req.Context().Config
|
||||
@ -92,7 +84,8 @@ var cmdIpfsTourNext = &cmds.Command{
|
||||
}
|
||||
|
||||
var cmdIpfsTourRestart = &cmds.Command{
|
||||
Help: "Restart the IPFS Tour.",
|
||||
Description: "Restart the IPFS Tour",
|
||||
|
||||
Run: func(res cmds.Response, req cmds.Request) {
|
||||
path := req.Context().ConfigRoot
|
||||
cfg := req.Context().Config
|
||||
@ -106,7 +99,8 @@ var cmdIpfsTourRestart = &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) {
|
||||
var w bytes.Buffer
|
||||
tourListCmd(&w, req.Context().Config)
|
||||
|
Reference in New Issue
Block a user