#[derive(Debug, Clone, PartialEq, Eq)]
pub struct LaunchCommand {
pub program: String,
pub args: Option<Vec<String>>,
pub extra_env: Vec<(String, String)>,
}
impl LaunchCommand {
pub fn new(program: String, args: Vec<String>) -> Self {
Self {
program,
args: Some(args),
extra_env: Vec::new(),
}
}
pub(crate) fn env(
&self,
config: &crate::config::Config,
) -> Option<std::collections::HashMap<String, String>> {
let mut env = crate::tab::build_shell_env(config.shell.shell_env.as_ref());
if let Some(env) = env.as_mut() {
env.extend(self.extra_env.iter().cloned());
}
env
}
}