From 168d704273d85306265889a239fbc7c87b1739f2 Mon Sep 17 00:00:00 2001 From: Jason Travis Smith Date: Sun, 31 Jul 2016 02:53:59 -0400 Subject: [PATCH] Arguments were being pushed together. Arguments were being grouped as "-i file.in" instead of "-i" "file.in". This meant that they were not being parsed right by Spellbooks ArgParser. They are now properly split up. --- src/processor.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/processor.rs b/src/processor.rs index ff1615e..ff46be8 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -464,6 +464,7 @@ impl Processor arg_compiler = compiler.args(&args); // Execute the compiler command. + println!("Running command: {:?}", arg_compiler); match arg_compiler.output() { Ok(output) => @@ -536,29 +537,26 @@ impl Processor /// to a compiler based on the given Section. fn build_args(&self, section: &Section) -> Vec { - let mut arg: String; + let arguments: String; let mut args: Vec; // Create a new array of determined arguments. args = Vec::new(); // First add the input argument. This is a mason compiler must have. - arg = String::new(); - arg.push_str("-i"); - arg.push_str(" "); - arg.push_str(section.src_path.as_str()); - args.push(arg); + args.push(String::from("-i")); + args.push(section.src_path.clone()); // Next add the output argument. This is a mason compiler must have. - arg = String::new(); - arg.push_str("-o"); - arg.push_str(" "); - arg.push_str(section.dst_path.as_str()); - args.push(arg); + args.push(String::from("-o")); + args.push(section.dst_path.clone()); // Parse all the arguments to pass to the compiler. - arg = section.arguments.clone(); - args.push(arg); + arguments = section.arguments.clone(); + for arg in arguments.split(' ') + { + args.push(String::from(arg)); + } args }