@@ -271,15 +271,16 @@ fn initialize_config_root(path: Option<&String>) -> Option<String> {
271271}
272272
273273#[ 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 ) {
275276 let ( new_parameters, json_string) = match subcommand {
276277 ConfigSubCommand :: Get { input, file, .. } |
277278 ConfigSubCommand :: Set { input, file, .. } |
278279 ConfigSubCommand :: Test { input, file, .. } |
279280 ConfigSubCommand :: Validate { input, file, .. } |
280281 ConfigSubCommand :: Export { input, file, .. } => {
281282 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 ) ;
283284 if * as_include {
284285 let ( new_parameters, config_json) = match get_contents ( & document) {
285286 Ok ( ( parameters, config_json) ) => ( parameters, config_json) ,
@@ -295,7 +296,7 @@ pub fn config(subcommand: &ConfigSubCommand, parameters: &Option<String>, mounte
295296 } ,
296297 ConfigSubCommand :: Resolve { input, file, .. } => {
297298 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 ) ;
299300 let ( new_parameters, config_json) = match get_contents ( & document) {
300301 Ok ( ( parameters, config_json) ) => ( parameters, config_json) ,
301302 Err ( err) => {
@@ -391,7 +392,7 @@ pub fn config(subcommand: &ConfigSubCommand, parameters: &Option<String>, mounte
391392 } ;
392393 if * as_include {
393394 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 ) ;
395396 match serde_json:: from_str :: < Include > ( & input) {
396397 Ok ( _) => {
397398 // valid, so do nothing
@@ -582,14 +583,14 @@ pub fn resource(subcommand: &ResourceSubCommand, progress_format: ProgressFormat
582583 } ,
583584 ResourceSubCommand :: Export { resource, input, file, output_format } => {
584585 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 ) ;
586587 resource_command:: export ( & mut dsc, resource, & parsed_input, output_format. as_ref ( ) ) ;
587588 } ,
588589 ResourceSubCommand :: Get { resource, input, file : path, all, output_format } => {
589590 dsc. find_resources ( & [ resource. to_string ( ) ] , progress_format) ;
590591 if * all { resource_command:: get_all ( & dsc, resource, output_format. as_ref ( ) ) ; }
591592 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 ) ;
593594 let format = match output_format {
594595 Some ( GetOutputFormat :: Json ) => Some ( OutputFormat :: Json ) ,
595596 Some ( GetOutputFormat :: JsonArray ) => {
@@ -605,17 +606,17 @@ pub fn resource(subcommand: &ResourceSubCommand, progress_format: ProgressFormat
605606 } ,
606607 ResourceSubCommand :: Set { resource, input, file : path, output_format } => {
607608 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 ) ;
609610 resource_command:: set ( & dsc, resource, & parsed_input, output_format. as_ref ( ) ) ;
610611 } ,
611612 ResourceSubCommand :: Test { resource, input, file : path, output_format } => {
612613 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 ) ;
614615 resource_command:: test ( & dsc, resource, & parsed_input, output_format. as_ref ( ) ) ;
615616 } ,
616617 ResourceSubCommand :: Delete { resource, input, file : path } => {
617618 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 ) ;
619620 resource_command:: delete ( & dsc, resource, & parsed_input) ;
620621 } ,
621622 }
0 commit comments