mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-29 18:30:05 +08:00
add final arguments verbose outputs
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -249,6 +249,7 @@ fn main() {
|
|||||||
|
|
||||||
let mut cmd = Command::new(cmd_bin);
|
let mut cmd = Command::new(cmd_bin);
|
||||||
cmd.envs(&new_env);
|
cmd.envs(&new_env);
|
||||||
|
let mut final_args:Vec<String> = vec![];
|
||||||
if args.len() > 1 {
|
if args.len() > 1 {
|
||||||
let arg1 = &args[1];
|
let arg1 = &args[1];
|
||||||
if arg1.starts_with("::") {
|
if arg1.starts_with("::") {
|
||||||
@@ -260,23 +261,29 @@ fn main() {
|
|||||||
print_message(MessageType::ERROR, "Only on xArgs argument, exit.");
|
print_message(MessageType::ERROR, "Only on xArgs argument, exit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmd.arg(arg1);
|
final_args.push(arg1.to_string());
|
||||||
} else {
|
} else {
|
||||||
for a_j in a_cmd_j.members() {
|
for a_j in a_cmd_j.members() {
|
||||||
if ! a_j.is_null() {
|
if ! a_j.is_null() {
|
||||||
cmd.arg(a_j.as_str().unwrap());
|
final_args.push(a_j.as_str().unwrap().to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmd.arg(arg1);
|
final_args.push(arg1.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if args.len() > 2 {
|
if args.len() > 2 {
|
||||||
for i in 2..args.len() {
|
for i in 2..args.len() {
|
||||||
cmd.arg(&args[i]);
|
final_args.push(args[i].to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if *VERBOSE {
|
||||||
|
print_message(MessageType::DEBUG, &format!("Final arguments: {:?}", &final_args));
|
||||||
|
}
|
||||||
|
for f_arg in final_args {
|
||||||
|
cmd.arg(f_arg);
|
||||||
|
}
|
||||||
if *VERBOSE {
|
if *VERBOSE {
|
||||||
print_message(MessageType::DEBUG, "-----Environment variables-----");
|
print_message(MessageType::DEBUG, "-----Environment variables-----");
|
||||||
for (k, v) in new_env {
|
for (k, v) in new_env {
|
||||||
|
|||||||
Reference in New Issue
Block a user