1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-02 03:28:25 +08:00

cmd/ipfs2: Added descriptions for 'init', 'tour'

This commit is contained in:
Matt Bell
2014-11-08 01:02:53 -08:00
committed by Juan Batiz-Benet
parent c2615d3481
commit 2b8ef917b8
2 changed files with 26 additions and 29 deletions

View File

@ -16,17 +16,20 @@ import (
) )
var initCmd = &cmds.Command{ var initCmd = &cmds.Command{
Options: []cmds.Option{ Description: "Initializes IPFS config file",
cmds.Option{[]string{"bits", "b"}, cmds.Int}, Help: `Initializes IPFS configuration files and generates a new keypair.
cmds.Option{[]string{"passphrase", "p"}, cmds.String}, `,
cmds.Option{[]string{"force", "f"}, cmds.Bool},
cmds.Option{[]string{"datastore", "d"}, cmds.String},
},
Help: `ipfs init
Initializes ipfs configuration files and generates a Options: []cmds.Option{
new keypair. 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) { Run: func(res cmds.Response, req cmds.Request) {
arg, found := req.Option("d") arg, found := req.Option("d")

View File

@ -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:
} }
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{
} }
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{
} }
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)