core/commands: pin ls: Default type to 'direct'
Matt Bell committed
Nov 19, 2014 at 01:44 UTC
928f20b4bd5c2a8df7fa96b767accddfc9d79d5a
1 file changed
+13
-2
core/commands/pin.go
+13
-2
@@ -107,11 +107,22 @@ var listPinCmd = &cmds.Command{
107
ShortDescription: `
108
Returns a list of hashes of objects being pinned. Objects that are indirectly
109
or recursively pinned are not included in the list.
110
+`,
111
+ LongDescription: `
112
+Returns a list of hashes of objects being pinned. Objects that are indirectly
113
+or recursively pinned are not included in the list.
114
+
115
+Use --type=<type> to specify the type of pinned keys to list. Valid values are:
116
+ * "direct"
117
+ * "indirect"
118
+ * "recursive"
119
+ * "all"
120
+(Defaults to "direct")
121
`,
122
},
123
124
Options: []cmds.Option{
114
- cmds.StringOption("type", "t", "The type of pinned keys to list. Can be \"direct\", \"indirect\", \"recursive\", or \"all\""),
125
+ cmds.StringOption("type", "t", "The type of pinned keys to list. Can be \"direct\", \"indirect\", \"recursive\", or \"all\". Defaults to \"direct\""),
126
},
127
Run: func(req cmds.Request) (interface{}, error) {
128
n, err := req.Context().GetNode()
@@ -124,7 +135,7 @@ or recursively pinned are not included in the list.
135
return nil, err
136
}
137
if !found {
127
- typeStr = "all"
138
+ typeStr = "direct"
139
}
140
141
if typeStr != "all" && typeStr != "direct" && typeStr != "indirect" && typeStr != "recursive" {