unixfs.go 1019 Bytes
Newer Older
1 2
package unixfs

Jan Winkelmann's avatar
Jan Winkelmann committed
3 4 5 6
import (
	cmds "github.com/ipfs/go-ipfs/commands"
	e "github.com/ipfs/go-ipfs/core/commands/e"

7
	"gx/ipfs/QmVD1W3MC8Hk1WZgFQPWWmBECJ3X72BgUYf9eCQ4PGzPps/go-ipfs-cmdkit"
Jan Winkelmann's avatar
Jan Winkelmann committed
8
)
9 10

var UnixFSCmd = &cmds.Command{
Jan Winkelmann's avatar
Jan Winkelmann committed
11
	Helptext: cmdkit.HelpText{
12
		Tagline: "Interact with IPFS objects representing Unix filesystems.",
13
		ShortDescription: `
14
'ipfs file' provides a familiar interface to file systems represented
15
by IPFS objects, which hides ipfs implementation details like layout
16
objects (e.g. fanout and chunking).
Richard Littauer's avatar
Richard Littauer committed
17
`,
Jakub Sztandera's avatar
Jakub Sztandera committed
18
		LongDescription: `
Richard Littauer's avatar
Richard Littauer committed
19
'ipfs file' provides a familiar interface to file systems represented
20
by IPFS objects, which hides ipfs implementation details like layout
Richard Littauer's avatar
Richard Littauer committed
21
objects (e.g. fanout and chunking).
22 23 24 25 26 27 28
`,
	},

	Subcommands: map[string]*cmds.Command{
		"ls": LsCmd,
	},
}
Jan Winkelmann's avatar
Jan Winkelmann committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42

// copy+pasted from ../commands.go
func unwrapOutput(i interface{}) (interface{}, error) {
	var (
		ch <-chan interface{}
		ok bool
	)

	if ch, ok = i.(<-chan interface{}); !ok {
		return nil, e.TypeErr(ch, i)
	}

	return <-ch, nil
}