diag.go 827 Bytes
Newer Older
Jeromy's avatar
Jeromy committed
1 2 3 4 5 6 7 8 9 10
package main

import (
	"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"

	"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
	"github.com/jbenet/go-ipfs/core/commands"
)

var cmdIpfsDiag = &commander.Command{
11
	UsageLine: "net-diag",
Jeromy's avatar
Jeromy committed
12
	Short:     "Generate a diagnostics report",
13
	Long: `ipfs net-diag - Generate a diagnostics report.
Jeromy's avatar
Jeromy committed
14 15 16 17 18 19

	Sends out a message to each node in the network recursively
	requesting a listing of data about them including number of
	connected peers and latencies between them.
`,
	Run:  diagCmd,
20
	Flag: *flag.NewFlagSet("ipfs-net-diag", flag.ExitOnError),
Jeromy's avatar
Jeromy committed
21 22
}

Jeromy's avatar
Jeromy committed
23 24 25 26
func init() {
	cmdIpfsDiag.Flag.Bool("raw", false, "print raw json output")
}

Jeromy's avatar
Jeromy committed
27 28 29
var diagCmd = makeCommand(command{
	name:  "diag",
	args:  0,
Jeromy's avatar
Jeromy committed
30
	flags: []string{"raw"},
Jeromy's avatar
Jeromy committed
31 32
	cmdFn: commands.Diag,
})