You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the `swift package-collection` command-line interface, SwiftPM users can subscribe to package collections. Contents of imported package
@@ -33,6 +56,13 @@ $ swift package-collection add file:///absolute/path/to/packages.json
33
56
Added "Sample Package Collection" to your package collections.
34
57
```
35
58
59
+
The optional `order` hint can be used to order collections and may potentially influence ranking in search results:
60
+
61
+
```bash
62
+
$ swift package-collection add https://www.example.com/packages.json [--order N]
63
+
Added "Sample Package Collection" to your package collections.
64
+
```
65
+
36
66
#### Signed package collections
37
67
38
68
Package collection publishers may sign a collection to protect its contents from being tampered with. If a collection is signed, SwiftPM will check that the
@@ -99,14 +129,15 @@ The `--skip-signature-check` flag has no effects on unsigned collections.
99
129
100
130
### `describe` subcommand
101
131
102
-
This subcommand shows metadata for a collection or a package included in an imported collection.
132
+
This subcommand shows metadata for a collection or a package included in an imported collection. The result can optionally be returned as JSON using `--json` for
133
+
integration into other tools.
103
134
104
135
#### Metadata and packages of a collection
105
136
106
137
`describe` can be used for both collections that have been previously added to the list of the user's configured collections, as well as to preview any other collections.
107
138
108
139
```bash
109
-
$ swift package-collection describe https://www.example.com/packages.json
140
+
$ swift package-collection describe [--json] https://www.example.com/packages.json
110
141
Name: Sample Package Collection
111
142
Source: https://www.example.com/packages.json
112
143
Description: ...
@@ -119,10 +150,10 @@ Packages:
119
150
120
151
#### Metadata of a package
121
152
122
-
`describe`shows the metadata of a package included in an imported collection:
153
+
`describe`can also show the metadata of a package included in an imported collection:
123
154
124
155
```bash
125
-
$ swift package-collection describe https://github.com/jpsim/yams
156
+
$ swift package-collection describe [--json] https://github.com/jpsim/yams
126
157
Description: A sweet and swifty YAML parser built on LibYAML.
The result can optionally be returned as JSON using `--json`for integration into other tools.
196
+
164
197
### `refresh` subcommand
165
198
166
199
This subcommand refreshes any cached data manually:
@@ -174,7 +207,7 @@ SwiftPM will also automatically refresh data under various conditions, but some
174
207
175
208
### `remove` subcommand
176
209
177
-
This subcommand removes as collection from the user's list of configured collections:
210
+
This subcommand removes a collection from the user's list of configured collections:
178
211
179
212
```bash
180
213
$ swift package-collection remove https://www.example.com/packages.json
@@ -183,14 +216,15 @@ Removed "Sample Package Collection" from your package collections.
183
216
184
217
### `search` subcommand
185
218
186
-
This subcommand searches for packages by keywords or module names within imported collections.
219
+
This subcommand searches for packages by keywords or module names within imported collections. The result can optionally be returned as JSON using `--json` for
220
+
integration into other tools.
187
221
188
222
#### String-based search
189
223
190
224
The search command does a string-based search when using the `--keywords` option and returns the list of packages that matches the query:
191
225
192
226
```bash
193
-
$ swift package-collection search --keywords yaml
227
+
$ swift package-collection search [--json] --keywords yaml
194
228
https://github.com/jpsim/yams: A sweet and swifty YAML parser built on LibYAML.
195
229
...
196
230
```
@@ -200,7 +234,7 @@ https://github.com/jpsim/yams: A sweet and swifty YAML parser built on LibYAML.
200
234
The search command does a search for a specific module name when using the `--module` option:
201
235
202
236
```bash
203
-
$ swift package-collection search --module yams
237
+
$ swift package-collection search [--json] --module yams
204
238
Package Name: Yams
205
239
Latest Version: 4.0.0
206
240
Description: A sweet and swifty YAML parser built on LibYAML.
0 commit comments