mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-23 19:37:46 +08:00
51 lines
1.0 KiB
Go
51 lines
1.0 KiB
Go
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 cmdIpfsCat = &commander.Command{
|
|
UsageLine: "cat",
|
|
Short: "Show ipfs object data.",
|
|
Long: `ipfs cat <ipfs-path> - Show ipfs object data.
|
|
|
|
Retrieves the object named by <ipfs-path> and displays the Data
|
|
it contains.
|
|
`,
|
|
Run: catCmd,
|
|
Flag: *flag.NewFlagSet("ipfs-cat", flag.ExitOnError),
|
|
}
|
|
|
|
var catCmd = MakeCommand("cat", nil, commands.Cat)
|
|
|
|
/*
|
|
func catCmd(c *commander.Command, inp []string) error {
|
|
if len(inp) < 1 {
|
|
u.POut(c.Long)
|
|
return nil
|
|
}
|
|
|
|
conf, err := getConfigDir(c.Parent)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
com := daemon.NewCommand()
|
|
com.Command = "cat"
|
|
com.Args = inp
|
|
|
|
err = daemon.SendCommand(com, conf)
|
|
if err != nil {
|
|
n, err := localNode(conf, false)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return commands.Cat(n, com.Args, com.Opts, os.Stdout)
|
|
}
|
|
return nil
|
|
}
|
|
*/
|