提交 65c6bd07 作者: Brian Tiger Chow

feat(core/commands): expose commands to allow for the development of high-level interface

+ style: sort command list

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 229c93f7
......@@ -26,7 +26,7 @@ type AddOutput struct {
Quiet bool
}
var addCmd = &cmds.Command{
var AddCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Add an object to ipfs.",
ShortDescription: `
......
......@@ -18,7 +18,7 @@ type Block struct {
Length int
}
var blockCmd = &cmds.Command{
var BlockCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Manipulate raw IPFS blocks",
ShortDescription: `
......
......@@ -19,7 +19,7 @@ type BootstrapOutput struct {
var peerOptionDesc = "A peer to add to the bootstrap list (in the format '<multiaddr>/<peerID>')"
var bootstrapCmd = &cmds.Command{
var BootstrapCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Show or edit the list of bootstrap peers",
Synopsis: `
......
......@@ -8,7 +8,7 @@ import (
uio "github.com/jbenet/go-ipfs/unixfs/io"
)
var catCmd = &cmds.Command{
var CatCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Show IPFS object data",
ShortDescription: `
......
......@@ -19,7 +19,7 @@ type ConfigField struct {
Value interface{}
}
var configCmd = &cmds.Command{
var ConfigCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "get and set IPFS config values",
Synopsis: `
......
......@@ -31,7 +31,7 @@ type IdOutput struct {
ProtocolVersion string
}
var idCmd = &cmds.Command{
var IDCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Show IPFS Node ID info",
ShortDescription: `
......
......@@ -21,7 +21,7 @@ type LsOutput struct {
Objects []Object
}
var lsCmd = &cmds.Command{
var LsCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "List links from an object.",
ShortDescription: `
......
......@@ -22,7 +22,7 @@ const mountTimeout = time.Second
// fuseNoDirectory used to check the returning fuse error
const fuseNoDirectory = "fusermount: failed to access mountpoint"
var mountCmd = &cmds.Command{
var MountCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Mounts IPFS to the filesystem (read-only)",
Synopsis: `
......
......@@ -7,7 +7,7 @@ type IpnsEntry struct {
Value string
}
var nameCmd = &cmds.Command{
var NameCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "IPFS namespace (IPNS) tool",
Synopsis: `
......
......@@ -24,7 +24,7 @@ type Node struct {
Data []byte
}
var objectCmd = &cmds.Command{
var ObjectCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Interact with ipfs objects",
ShortDescription: `
......
......@@ -9,7 +9,7 @@ import (
u "github.com/jbenet/go-ipfs/util"
)
var pinCmd = &cmds.Command{
var PinCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Pin (and unpin) objects to local storage",
},
......
......@@ -25,7 +25,7 @@ func KeyListTextMarshaler(res cmds.Response) ([]byte, error) {
return []byte(s), nil
}
var refsCmd = &cmds.Command{
var RefsCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Lists link hashes from an object",
ShortDescription: `
......
......@@ -62,24 +62,24 @@ Use 'ipfs <command> --help' to learn more about each command.
var CommandsDaemonCmd = CommandsCmd(Root)
var rootSubcommands = map[string]*cmds.Command{
"cat": catCmd,
"ls": lsCmd,
"add": AddCmd,
"block": BlockCmd,
"bootstrap": BootstrapCmd,
"cat": CatCmd,
"commands": CommandsDaemonCmd,
"name": nameCmd,
"add": addCmd,
"log": LogCmd,
"config": ConfigCmd,
"diag": DiagCmd,
"pin": pinCmd,
"version": VersionCmd,
"config": configCmd,
"bootstrap": bootstrapCmd,
"mount": mountCmd,
"block": blockCmd,
"id": IDCmd,
"log": LogCmd,
"ls": LsCmd,
"mount": MountCmd,
"name": NameCmd,
"object": ObjectCmd,
"pin": PinCmd,
"refs": RefsCmd,
"swarm": SwarmCmd,
"update": UpdateCmd,
"object": objectCmd,
"refs": refsCmd,
"id": idCmd,
"swarm": swarmCmd,
"version": VersionCmd,
}
func init() {
......
......@@ -17,7 +17,7 @@ type stringList struct {
Strings []string
}
var swarmCmd = &cmds.Command{
var SwarmCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "swarm inspection tool",
Synopsis: `
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论