Updated `file` helptext
Part of #2647 License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
Richard Littauer committed
May 12, 2016 at 13:42 UTC
185619f68913dcb83237a6e4c5c470e2b1db2db0
2 files changed
+26
-2
core/commands/unixfs/ls.go
+20
-2
@@ -9,10 +9,10 @@ import (
9
10
cmds "github.com/ipfs/go-ipfs/commands"
11
core "github.com/ipfs/go-ipfs/core"
12
+ merkledag "github.com/ipfs/go-ipfs/merkledag"
13
path "github.com/ipfs/go-ipfs/path"
14
unixfs "github.com/ipfs/go-ipfs/unixfs"
15
unixfspb "github.com/ipfs/go-ipfs/unixfs/pb"
15
- merkledag "github.com/ipfs/go-ipfs/merkledag"
16
)
17
18
type LsLink struct {
@@ -36,12 +36,30 @@ type LsOutput struct {
36
var LsCmd = &cmds.Command{
37
Helptext: cmds.HelpText{
38
Tagline: "List directory contents for Unix filesystem objects.",
39
+ Synopsis: "ipfs file ls <path>",
40
ShortDescription: `
40
-Displays the contents of an IPFS or IPNS object(s) at the given path.
41
+Displays the contents of an IPFS or IPNS object(s) at the given path.
42
+
43
+The JSON output contains size information. For files, the child size
44
+is the total size of the file contents. For directories, the child
45
+size is the IPFS link size.
46
+`,
47
+ LongDescription: `
48
+Displays the contents of an IPFS or IPNS object(s) at the given path.
49
50
The JSON output contains size information. For files, the child size
51
is the total size of the file contents. For directories, the child
52
size is the IPFS link size.
53
+
54
+The path can be a prefixless ref; in this case, we assume it to be an
55
+/ipfs ref and not /ipns.
56
+
57
+Example:
58
+
59
+ > ipfs file ls QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ
60
+ cat.jpg
61
+ > ipfs file ls /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ
62
+ cat.jpg
63
`,
64
},
65
core/commands/unixfs/unixfs.go
+6
@@ -5,10 +5,16 @@ import cmds "github.com/ipfs/go-ipfs/commands"
5
var UnixFSCmd = &cmds.Command{
6
Helptext: cmds.HelpText{
7
Tagline: "Interact with ipfs objects representing Unix filesystems.",
8
+ Synopsis: "ipfs file <command>",
9
ShortDescription: `
10
'ipfs file' provides a familiar interface to file systems represented
11
by IPFS objects, which hides IPFS implementation details like layout
12
objects (e.g. fanout and chunking).
13
+`,
14
+ LongDescription: `
15
+'ipfs file' provides a familiar interface to file systems represented
16
+by IPFS objects, which hides IPFS implementation details like layout
17
+objects (e.g. fanout and chunking).
18
`,
19
},
20