(
tracedecay_bin: &str,
subcommand: &str,
windows: bool,
)
| 870 | } |
| 871 | |
| 872 | pub(crate) fn hook_command_for_platform( |
| 873 | tracedecay_bin: &str, |
| 874 | subcommand: &str, |
| 875 | windows: bool, |
| 876 | ) -> String { |
| 877 | let quoted = if windows { |
| 878 | quote_windows_command_arg(&normalize_path_separators(tracedecay_bin)) |
| 879 | } else { |
| 880 | quote_posix_command_arg(tracedecay_bin) |
| 881 | }; |
| 882 | format!("{quoted} {subcommand}") |
| 883 | } |
| 884 | |
| 885 | fn quote_windows_command_arg(value: &str) -> String { |
| 886 | format!("\"{}\"", value.replace('"', "\\\"")) |