Skip to content

Commit

Permalink
feat: Highlight the re-run command to make it more prominent (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
garikbesson authored Apr 13, 2024
1 parent dadfff8 commit a1bde9a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use clap::Parser;
#[cfg(feature = "self-update")]
use color_eyre::eyre::WrapErr;
use color_eyre::owo_colors::OwoColorize;
use interactive_clap::ToCliArgs;

pub use near_cli_rs::commands;
Expand Down Expand Up @@ -79,10 +80,11 @@ fn main() -> crate::common::CliResult {
eprintln!("{success_message}");
eprintln!();
eprintln!(
"{}",
" {}",
shell_words::join(
std::iter::once(near_cli_exec_path).chain(vec_cmd)
)
.yellow()
);
}
Err(err) => {
Expand Down Expand Up @@ -112,10 +114,11 @@ fn main() -> crate::common::CliResult {
interactive_clap::ResultFromCli::Ok(cli_cmd)
| interactive_clap::ResultFromCli::Cancel(Some(cli_cmd)) => {
eprintln!(
"\nHere is your console command if you need to script it or re-run:\n{}",
"\n\nHere is your console command if you need to script it or re-run:\n {}\n",
shell_words::join(
std::iter::once(&near_cli_exec_path).chain(&cli_cmd.to_cli_args())
)
.yellow()
);
Ok(Some(cli_cmd))
}
Expand All @@ -129,10 +132,11 @@ fn main() -> crate::common::CliResult {
interactive_clap::ResultFromCli::Err(optional_cli_cmd, err) => {
if let Some(cli_cmd) = optional_cli_cmd {
eprintln!(
"\nHere is your console command if you need to script it or re-run:\n{}",
"\nHere is your console command if you need to script it or re-run:\n {}\n",
shell_words::join(
std::iter::once(&near_cli_exec_path).chain(&cli_cmd.to_cli_args())
)
.yellow()
);
}
Err(err)
Expand Down Expand Up @@ -185,6 +189,7 @@ fn main() -> crate::common::CliResult {
std::iter::once(near_cli_exec_path)
.chain(self_update_cli_cmd.to_cli_args())
)
.yellow()
);
}
}
Expand Down

0 comments on commit a1bde9a

Please sign in to comment.