@@ -271,15 +271,16 @@ fn initialize_config_root(path: Option<&String>) -> Option<String> {
271
271
}
272
272
273
273
#[ allow( clippy:: too_many_lines) ]
274
- pub fn config ( subcommand : & ConfigSubCommand , parameters : & Option < String > , mounted_path : Option < & String > , as_group : & bool , as_assert : & bool , as_include : & bool , progress_format : ProgressFormat ) {
274
+ #[ allow( clippy:: too_many_arguments) ]
275
+ pub fn config ( subcommand : & ConfigSubCommand , parameters : & Option < String > , parameters_from_stdin : bool , mounted_path : Option < & String > , as_group : & bool , as_assert : & bool , as_include : & bool , progress_format : ProgressFormat ) {
275
276
let ( new_parameters, json_string) = match subcommand {
276
277
ConfigSubCommand :: Get { input, file, .. } |
277
278
ConfigSubCommand :: Set { input, file, .. } |
278
279
ConfigSubCommand :: Test { input, file, .. } |
279
280
ConfigSubCommand :: Validate { input, file, .. } |
280
281
ConfigSubCommand :: Export { input, file, .. } => {
281
282
let new_path = initialize_config_root ( file. as_ref ( ) ) ;
282
- let document = get_input ( input. as_ref ( ) , new_path. as_ref ( ) ) ;
283
+ let document = get_input ( input. as_ref ( ) , new_path. as_ref ( ) , parameters_from_stdin ) ;
283
284
if * as_include {
284
285
let ( new_parameters, config_json) = match get_contents ( & document) {
285
286
Ok ( ( parameters, config_json) ) => ( parameters, config_json) ,
@@ -295,7 +296,7 @@ pub fn config(subcommand: &ConfigSubCommand, parameters: &Option<String>, mounte
295
296
} ,
296
297
ConfigSubCommand :: Resolve { input, file, .. } => {
297
298
let new_path = initialize_config_root ( file. as_ref ( ) ) ;
298
- let document = get_input ( input. as_ref ( ) , new_path. as_ref ( ) ) ;
299
+ let document = get_input ( input. as_ref ( ) , new_path. as_ref ( ) , parameters_from_stdin ) ;
299
300
let ( new_parameters, config_json) = match get_contents ( & document) {
300
301
Ok ( ( parameters, config_json) ) => ( parameters, config_json) ,
301
302
Err ( err) => {
@@ -391,7 +392,7 @@ pub fn config(subcommand: &ConfigSubCommand, parameters: &Option<String>, mounte
391
392
} ;
392
393
if * as_include {
393
394
let new_path = initialize_config_root ( file. as_ref ( ) ) ;
394
- let input = get_input ( input. as_ref ( ) , new_path. as_ref ( ) ) ;
395
+ let input = get_input ( input. as_ref ( ) , new_path. as_ref ( ) , parameters_from_stdin ) ;
395
396
match serde_json:: from_str :: < Include > ( & input) {
396
397
Ok ( _) => {
397
398
// valid, so do nothing
@@ -582,14 +583,14 @@ pub fn resource(subcommand: &ResourceSubCommand, progress_format: ProgressFormat
582
583
} ,
583
584
ResourceSubCommand :: Export { resource, input, file, output_format } => {
584
585
dsc. find_resources ( & [ resource. to_string ( ) ] , progress_format) ;
585
- let parsed_input = get_input ( input. as_ref ( ) , file. as_ref ( ) ) ;
586
+ let parsed_input = get_input ( input. as_ref ( ) , file. as_ref ( ) , false ) ;
586
587
resource_command:: export ( & mut dsc, resource, & parsed_input, output_format. as_ref ( ) ) ;
587
588
} ,
588
589
ResourceSubCommand :: Get { resource, input, file : path, all, output_format } => {
589
590
dsc. find_resources ( & [ resource. to_string ( ) ] , progress_format) ;
590
591
if * all { resource_command:: get_all ( & dsc, resource, output_format. as_ref ( ) ) ; }
591
592
else {
592
- let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) ) ;
593
+ let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) , false ) ;
593
594
let format = match output_format {
594
595
Some ( GetOutputFormat :: Json ) => Some ( OutputFormat :: Json ) ,
595
596
Some ( GetOutputFormat :: JsonArray ) => {
@@ -605,17 +606,17 @@ pub fn resource(subcommand: &ResourceSubCommand, progress_format: ProgressFormat
605
606
} ,
606
607
ResourceSubCommand :: Set { resource, input, file : path, output_format } => {
607
608
dsc. find_resources ( & [ resource. to_string ( ) ] , progress_format) ;
608
- let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) ) ;
609
+ let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) , false ) ;
609
610
resource_command:: set ( & dsc, resource, & parsed_input, output_format. as_ref ( ) ) ;
610
611
} ,
611
612
ResourceSubCommand :: Test { resource, input, file : path, output_format } => {
612
613
dsc. find_resources ( & [ resource. to_string ( ) ] , progress_format) ;
613
- let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) ) ;
614
+ let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) , false ) ;
614
615
resource_command:: test ( & dsc, resource, & parsed_input, output_format. as_ref ( ) ) ;
615
616
} ,
616
617
ResourceSubCommand :: Delete { resource, input, file : path } => {
617
618
dsc. find_resources ( & [ resource. to_string ( ) ] , progress_format) ;
618
- let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) ) ;
619
+ let parsed_input = get_input ( input. as_ref ( ) , path. as_ref ( ) , false ) ;
619
620
resource_command:: delete ( & dsc, resource, & parsed_input) ;
620
621
} ,
621
622
}
0 commit comments