core/commands/pin: update 'ipfs pin ls' documentation
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Jan 16, 2016 at 16:59 UTC
f5f923a7a893ba5ca12a05cdd00c48c6c648a275
1 file changed
+11
-4
core/commands/pin.go
+11
-4
@@ -161,11 +161,11 @@ var listPinCmd = &cmds.Command{
161
Tagline: "List objects pinned to local storage",
162
ShortDescription: `
163
Returns a list of objects that are pinned locally.
164
-By default, only recursively pinned returned, but others may be shown via the '--type' flag.
164
+Without arguments, by default, only recursively pinned objects are returned, but others may be shown via the '--type' flag.
165
`,
166
LongDescription: `
167
Returns a list of objects that are pinned locally.
168
-By default, only recursively pinned returned, but others may be shown via the '--type' flag.
168
+Without arguments, by default, only recursively pinned objects are returned, but others may be shown via the '--type' flag.
169
170
Use --type=<type> to specify the type of pinned keys to list. Valid values are:
171
* "direct": pin that specific object.
@@ -173,16 +173,23 @@ Use --type=<type> to specify the type of pinned keys to list. Valid values are:
173
* "indirect": pinned indirectly by an ancestor (like a refcount)
174
* "all"
175
176
+With arguments, the command fails if any of the arguments is not a pinned object.
177
+And if --type=<type> is additionally used, the command will also fail if any of the arguments is not of the specified type.
178
+
179
Example:
180
$ echo "hello" | ipfs add -q
181
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
182
$ ipfs pin ls
180
- QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
183
+ QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN recursive
184
# now remove the pin, and repin it directly
185
$ ipfs pin rm QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
186
+ unpinned QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
187
$ ipfs pin add -r=false QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
188
+ pinned QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN directly
189
$ ipfs pin ls --type=direct
185
- QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
190
+ QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN direct
191
+ $ ipfs pin ls QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
192
+ QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN direct
193
`,
194
},
195