Skip to content

Commit

Permalink
refactor(commands): update commands.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
omarabid committed Feb 4, 2024
1 parent d3ab54d commit 039b529
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions core/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,27 @@ pub fn helpme() -> Result<()> {
}
};

// ask user if they want to proceed with the command(s)
println!(":: Prooced with Command(s)?: [Y/n] ");

// get user input
let mut input = String::new();
std::io::stdin().read_line(&mut input)?;

// if user input is Y, execute GPTResponse
if input.trim() == "Y" {
execute_gptresponse(gpt_response)?;
match gpt_response.status {
crate::decode::ResponseStatus::Success => {
// ask user if they want to proceed with the command(s)
println!(":: Prooced with Command(s)?: [Y/n] ");
println!(":: Giton Success");

// get user input
let mut input = String::new();
std::io::stdin().read_line(&mut input)?;

// if user input is Y, execute GPTResponse
if input.trim() == "Y" {
execute_gptresponse(gpt_response)?;
}
}
crate::decode::ResponseStatus::NotValid => {
println!("Invalid: {}", &gpt_response.explanation);
}
crate::decode::ResponseStatus::NotPossible => {
println!("Not Possible: {}", &gpt_response.explanation);
}
}

Ok(())
Expand Down

0 comments on commit 039b529

Please sign in to comment.