File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,10 @@ pub struct ServeArgs {
151
151
/// The pgstac connection string.
152
152
#[ arg( long) ]
153
153
pub pgstac : Option < String > ,
154
+
155
+ /// Don't auto-create collections for items that are missing them.
156
+ #[ arg( short, long) ]
157
+ pub dont_auto_create_collections : bool ,
154
158
}
155
159
156
160
/// Arguments for sorting a STAC value.
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ impl Subcommand {
12
12
{
13
13
let mut backend = stac_server:: PgstacBackend :: new_from_stringlike ( pgstac) . await ?;
14
14
if !args. href . is_empty ( ) {
15
- backend. add_from_hrefs ( & args. href ) . await ?;
15
+ backend
16
+ . add_from_hrefs ( & args. href , !args. dont_auto_create_collections )
17
+ . await ?;
16
18
}
17
19
let api = Api :: new ( backend, root) ?;
18
20
let router = stac_server:: routes:: from_api ( api) ;
@@ -29,7 +31,9 @@ impl Subcommand {
29
31
} else {
30
32
let mut backend = MemoryBackend :: new ( ) ;
31
33
if !args. href . is_empty ( ) {
32
- backend. add_from_hrefs ( & args. href ) . await ?;
34
+ backend
35
+ . add_from_hrefs ( & args. href , !args. dont_auto_create_collections )
36
+ . await ?;
33
37
}
34
38
let api = Api :: new ( backend, root) ?;
35
39
let router = stac_server:: routes:: from_api ( api) ;
You can’t perform that action at this time.
0 commit comments