提交 c312cfff 作者: Steven Allen

feat: add install instructions for external commands

Issue reported on IRC.
上级 8417818a
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
cmds "github.com/ipfs/go-ipfs-cmds" cmds "github.com/ipfs/go-ipfs-cmds"
) )
func ExternalBinary() *cmds.Command { func ExternalBinary(instructions string) *cmds.Command {
return &cmds.Command{ return &cmds.Command{
Arguments: []cmds.Argument{ Arguments: []cmds.Argument{
cmds.StringArg("args", false, true, "Arguments for subcommand."), cmds.StringArg("args", false, true, "Arguments for subcommand."),
...@@ -27,7 +27,7 @@ func ExternalBinary() *cmds.Command { ...@@ -27,7 +27,7 @@ func ExternalBinary() *cmds.Command {
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
fmt.Fprintf(buf, "%s is an 'external' command.\n", binname) fmt.Fprintf(buf, "%s is an 'external' command.\n", binname)
fmt.Fprintf(buf, "It does not currently appear to be installed.\n") fmt.Fprintf(buf, "It does not currently appear to be installed.\n")
fmt.Fprintf(buf, "Please refer to the ipfs documentation for instructions.\n") fmt.Fprintf(buf, "%s\n", instructions)
return res.Emit(buf) return res.Emit(buf)
} }
} }
......
...@@ -144,7 +144,7 @@ var rootSubcommands = map[string]*cmds.Command{ ...@@ -144,7 +144,7 @@ var rootSubcommands = map[string]*cmds.Command{
"swarm": SwarmCmd, "swarm": SwarmCmd,
"tar": TarCmd, "tar": TarCmd,
"file": unixfs.UnixFSCmd, "file": unixfs.UnixFSCmd,
"update": ExternalBinary(), "update": ExternalBinary("Please see https://git.io/fjylH for installation instructions."),
"urlstore": urlStoreCmd, "urlstore": urlStoreCmd,
"version": VersionCmd, "version": VersionCmd,
"shutdown": daemonShutdownCmd, "shutdown": daemonShutdownCmd,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论