Skip to content

Commit

Permalink
exec format OK
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant0wan committed May 9, 2023
1 parent 1874cd5 commit 4ac9ef6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn print_usage() {
}

pub fn parse_commands() -> (Vec<String>, Commands) {
let mut args: Vec<String> = env::args().collect();
let mut args: Vec<String> = env::args().skip(1).collect();
let mut cmd = Commands {
interactive: false,
concurrent: false,
Expand All @@ -28,7 +28,7 @@ pub fn parse_commands() -> (Vec<String>, Commands) {
};
let mut allformats: Vec<String> = Vec::new();

let mut args_iter = args.iter().skip(1);
let mut args_iter = args.iter();
while let Some(arg) = args_iter.next() {
match arg.as_str() {
"-interactive" => match env::var("TF_IN_AUTOMATION") {
Expand Down Expand Up @@ -75,7 +75,6 @@ pub fn parse_commands() -> (Vec<String>, Commands) {
_ => {}
}
}

if cmd.interactive || cmd.automation {
args.retain(|x| x != "-interactive");
}
Expand Down
4 changes: 2 additions & 2 deletions src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ pub fn execute_varfiles(args: Vec<String>, cmd: Commands) {

fn exec(args: Vec<String>, varfile: String, workspaceformat: String) {
println!(
"TF_WORKSPACE={} {:?} -var-file={:?}",
"TF_WORKSPACE={} terraform {} -var-file={:?}",
get_workspace(varfile.clone(), workspaceformat),
args,
args.join(" "),
varfile
);
}
Expand Down

0 comments on commit 4ac9ef6

Please sign in to comment.