package main import ( flag "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag" commander "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander" "github.com/jbenet/go-ipfs/core/commands" ) var cmdIpfsBlock = &commander.Command{ UsageLine: "block", Short: "manipulate raw ipfs blocks", Long: `ipfs block - manipulate raw ipfs blocks ipfs block get - get and output block named by ipfs block put - store stdin as a block, outputs ipfs block is a plumbing command used to manipulate raw ipfs blocks. Reads from stdin or writes to stdout, and is a base58 encoded multihash.`, // Run: blockGetCmd, Subcommands: []*commander.Command{ cmdIpfsBlockGet, cmdIpfsBlockPut, }, Flag: *flag.NewFlagSet("ipfs-block", flag.ExitOnError), } var cmdIpfsBlockGet = &commander.Command{ UsageLine: "get ", Short: "get and output block named by ", Long: `ipfs get - get and output block named by ipfs block get is a plumbing command for retreiving raw ipfs blocks. It outputs to stdout, and is a base58 encoded multihash.`, Run: makeCommand(command{ name: "blockGet", args: 1, flags: nil, online: true, cmdFn: commands.BlockGet, }), } var cmdIpfsBlockPut = &commander.Command{ UsageLine: "put", Short: "store stdin as a block, outputs ", Long: `ipfs put - store stdin as a block, outputs ipfs block put is a plumbing command for storing raw ipfs blocks. It reads from stding, and is a base58 encoded multihash.`, Run: makeCommand(command{ name: "blockPut", args: 0, flags: nil, online: true, cmdFn: commands.BlockPut, }), }