Function
load_default_argv
(
args: &mut Vec<String>,
firedbg_config: &cfg::Config,
config: &Option<String>,
target_type: &cfg::TargetType,
)
Source from the content-addressed store, hash-verified
| 1088 | } |
| 1089 | |
| 1090 | fn load_default_argv( |
| 1091 | args: &mut Vec<String>, |
| 1092 | firedbg_config: &cfg::Config, |
| 1093 | config: &Option<String>, |
| 1094 | target_type: &cfg::TargetType, |
| 1095 | ) -> Result<()> { |
| 1096 | if !args.is_empty() { |
| 1097 | return Ok(()); |
| 1098 | } |
| 1099 | if config.is_none() { |
| 1100 | return Ok(()); |
| 1101 | } |
| 1102 | let config = config.as_ref().unwrap(); |
| 1103 | for cfg::Target { name, target, argv } in firedbg_config.targets.iter() { |
| 1104 | if name != config { |
| 1105 | continue; |
| 1106 | } |
| 1107 | if target != target_type { |
| 1108 | continue; |
| 1109 | } |
| 1110 | *args = argv.clone(); |
| 1111 | return Ok(()); |
| 1112 | } |
| 1113 | anyhow::bail!("Run config `{}` cannot be found in `firedbg.toml`", config) |
| 1114 | } |
Tested by
no test coverage detected