From aa15ed9d7e39c8976aa1681557b514b1efe39f76 Mon Sep 17 00:00:00 2001 From: Alexandre Pere Date: Tue, 3 Dec 2019 15:00:16 +0100 Subject: [PATCH] Fixes bug --- runaway-cli/src/subcommands/exec.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runaway-cli/src/subcommands/exec.rs b/runaway-cli/src/subcommands/exec.rs index 256996c..5484a53 100644 --- a/runaway-cli/src/subcommands/exec.rs +++ b/runaway-cli/src/subcommands/exec.rs @@ -32,7 +32,6 @@ use tracing::{self, info, error, debug}; /// Executes a single execution of the script with the command arguments and returns exit code. pub fn exec(matches: clap::ArgMatches) -> Result{ - // We initialize the logger misc::init_logger(&matches); @@ -60,7 +59,10 @@ pub fn exec(matches: clap::ArgMatches) -> Result{ } push_env(&mut store, "RUNAWAY_LEAVE", format!("{}", leave)); debug!("Leave option set to {}", leave); - let parameters = matches.value_of("ARGUMENTS").unwrap_or("").to_owned(); + let parameters = match matches.values_of("ARGUMENTS"){ + Some(it) => it.fold(String::new(), |acc, arg| format!("{} {}", acc, arg)), + None => "".to_owned() + }; push_env(&mut store, "RUNAWAY_ARGUMENTS", parameters.clone()); debug!("Arguments set to {}", parameters); let script = PathBuf::from(matches.value_of("SCRIPT").unwrap()); -- GitLab