summaryrefslogtreecommitdiff
path: root/src/run.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-08-20 16:04:29 +0200
committermo8it <mo8it@proton.me>2024-08-20 16:04:29 +0200
commite7ba88f90594962795bd028a8537efd6b1eedf6e (patch)
tree067a07d00124db850525182470d9fe2fa9cc3d78 /src/run.rs
parent50f6e5232e342931beec67a7edae191feadf4d75 (diff)
Highlight the solution file
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/run.rs b/src/run.rs
index 964e13b..0bc965c 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -33,18 +33,21 @@ pub fn run(app_state: &mut AppState) -> Result<()> {
)?;
if let Some(solution_path) = app_state.current_solution_path()? {
- println!(
- "\nA solution file can be found at {}\n",
- style(TerminalFileLink(&solution_path)).underlined().green(),
- );
+ writeln!(
+ stdout,
+ "\n{} for comparison: {}\n",
+ "Solution".bold(),
+ style(TerminalFileLink(&solution_path)).underlined().cyan(),
+ )?;
}
match app_state.done_current_exercise(&mut stdout)? {
ExercisesProgress::AllDone => (),
- ExercisesProgress::CurrentPending | ExercisesProgress::NewPending => println!(
+ ExercisesProgress::CurrentPending | ExercisesProgress::NewPending => writeln!(
+ stdout,
"Next exercise: {}",
app_state.current_exercise().terminal_link(),
- ),
+ )?,
}
Ok(())