Merge pull request #6541 from ipfs/fix/external-command-install

feat: add install instructions for external commands
This commit is contained in:
Steven Allen 2019-07-26 13:12:04 -07:00 committed by GitHub
commit 1fdff60ceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import (
cmds "github.com/ipfs/go-ipfs-cmds"
)
func ExternalBinary() *cmds.Command {
func ExternalBinary(instructions string) *cmds.Command {
return &cmds.Command{
Arguments: []cmds.Argument{
cmds.StringArg("args", false, true, "Arguments for subcommand."),
@ -27,7 +27,7 @@ func ExternalBinary() *cmds.Command {
buf := new(bytes.Buffer)
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, "Please refer to the ipfs documentation for instructions.\n")
fmt.Fprintf(buf, "%s\n", instructions)
return res.Emit(buf)
}
}

View File

@ -144,7 +144,7 @@ var rootSubcommands = map[string]*cmds.Command{
"swarm": SwarmCmd,
"tar": TarCmd,
"file": unixfs.UnixFSCmd,
"update": ExternalBinary(),
"update": ExternalBinary("Please see https://git.io/fjylH for installation instructions."),
"urlstore": urlStoreCmd,
"version": VersionCmd,
"shutdown": daemonShutdownCmd,