forked from ipfs/kubo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unixfs.go
42 lines (35 loc) · 1019 Bytes
/
unixfs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package unixfs
import (
cmds "github.com/ipfs/go-ipfs/commands"
e "github.com/ipfs/go-ipfs/core/commands/e"
"gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit"
)
var UnixFSCmd = &cmds.Command{
Helptext: cmdkit.HelpText{
Tagline: "Interact with IPFS objects representing Unix filesystems.",
ShortDescription: `
'ipfs file' provides a familiar interface to file systems represented
by IPFS objects, which hides ipfs implementation details like layout
objects (e.g. fanout and chunking).
`,
LongDescription: `
'ipfs file' provides a familiar interface to file systems represented
by IPFS objects, which hides ipfs implementation details like layout
objects (e.g. fanout and chunking).
`,
},
Subcommands: map[string]*cmds.Command{
"ls": LsCmd,
},
}
// 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
}