Get user-facing CLI flags (e.g. `--bin-path`) for all module-specific options that were explicitly provided via CLI.
(&self, command: &Command, matches: &ArgMatches)
| 465 | /// Get user-facing CLI flags (e.g. `--bin-path`) for all module-specific options |
| 466 | /// that were explicitly provided via CLI. |
| 467 | pub fn module_specific_cli_flags(&self, command: &Command, matches: &ArgMatches) -> Vec<String> { |
| 468 | self.module_specific_cli_args(matches) |
| 469 | .iter() |
| 470 | .map(|arg| { |
| 471 | let clap_name = self.clap_arg_name_for(arg); |
| 472 | command |
| 473 | .get_arguments() |
| 474 | .find(|a| a.get_id().as_str() == clap_name) |
| 475 | .and_then(|a| a.get_long()) |
| 476 | .map(|long| format!("--{long}")) |
| 477 | .unwrap_or_else(|| format!("--{}", clap_name.replace('_', "-"))) |
| 478 | }) |
| 479 | .collect() |
| 480 | } |
| 481 | |
| 482 | /// Validate that module-specific CLI flags are not used when operating on multiple targets. |
| 483 | pub fn validate_no_module_specific_cli_args_for_multiple_targets( |
no test coverage detected