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.
This commit is contained in:
Myrddin Dundragon 2016-07-31 02:53:59 -04:00
parent 75a7ba6a7a
commit 168d704273

View File

@ -464,6 +464,7 @@ impl Processor
arg_compiler = compiler.args(&args); arg_compiler = compiler.args(&args);
// Execute the compiler command. // Execute the compiler command.
println!("Running command: {:?}", arg_compiler);
match arg_compiler.output() match arg_compiler.output()
{ {
Ok(output) => Ok(output) =>
@ -536,29 +537,26 @@ impl Processor
/// to a compiler based on the given Section. /// to a compiler based on the given Section.
fn build_args(&self, section: &Section) -> Vec<String> fn build_args(&self, section: &Section) -> Vec<String>
{ {
let mut arg: String; let arguments: String;
let mut args: Vec<String>; let mut args: Vec<String>;
// Create a new array of determined arguments. // Create a new array of determined arguments.
args = Vec::new(); args = Vec::new();
// First add the input argument. This is a mason compiler must have. // First add the input argument. This is a mason compiler must have.
arg = String::new(); args.push(String::from("-i"));
arg.push_str("-i"); args.push(section.src_path.clone());
arg.push_str(" ");
arg.push_str(section.src_path.as_str());
args.push(arg);
// Next add the output argument. This is a mason compiler must have. // Next add the output argument. This is a mason compiler must have.
arg = String::new(); args.push(String::from("-o"));
arg.push_str("-o"); args.push(section.dst_path.clone());
arg.push_str(" ");
arg.push_str(section.dst_path.as_str());
args.push(arg);
// Parse all the arguments to pass to the compiler. // Parse all the arguments to pass to the compiler.
arg = section.arguments.clone(); arguments = section.arguments.clone();
args.push(arg); for arg in arguments.split(' ')
{
args.push(String::from(arg));
}
args args
} }