@@ -10,7 +10,7 @@ mod serve;
1010mod translate;
1111mod validate;
1212
13- use crate :: { Entry , Input , Output , Result , Value } ;
13+ use crate :: { config :: Entry , input :: Input , output :: Output , Result , Value } ;
1414use clap:: Parser ;
1515use tokio:: sync:: mpsc:: Sender ;
1616use tokio:: task:: JoinHandle ;
@@ -35,10 +35,14 @@ pub struct Args {
3535 #[ arg( short, long, global = true ) ]
3636 output_format : Option < crate :: output:: Format > ,
3737
38- /// key=value pairs to use for the input object store
38+ /// key=value pairs to use for the output object store
3939 #[ arg( short = 'c' , long) ]
4040 output_config : Vec < Entry > ,
4141
42+ /// If the output is a local file, create its parent directories before creating the file
43+ #[ arg( long, default_value_t = true ) ]
44+ create_parent_directories : bool ,
45+
4246 /// Stream the items to output as ndjson, default behavior is to return them all at the end of the operation
4347 #[ arg( short, long) ]
4448 stream : bool ,
@@ -69,10 +73,10 @@ pub struct Args {
6973 subcommand : Subcommand ,
7074}
7175
72- /// A sucommand .
76+ /// A subcommand .
7377#[ derive( Debug , clap:: Subcommand ) ]
7478#[ allow( clippy:: large_enum_variant) ]
75- pub enum Subcommand {
79+ enum Subcommand {
7680 /// Create a STAC Item from an id or the href to an asset
7781 Item ( item:: Args ) ,
7882
@@ -137,7 +141,9 @@ impl Args {
137141 }
138142 } ) ,
139143 self . output_config ,
140- ) ?;
144+ self . create_parent_directories ,
145+ )
146+ . await ?;
141147 let value = if self . stream {
142148 if output. format != crate :: output:: Format :: NdJson {
143149 tracing:: warn!(
0 commit comments