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);
// 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<String>
{
let mut arg: String;
let arguments: String;
let mut args: Vec<String>;
// 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
}