Show the current exercise path

This commit is contained in:
mo8it 2024-04-10 14:29:31 +02:00
parent 62e92476e6
commit a59acf8835
2 changed files with 7 additions and 1 deletions

View file

@ -49,7 +49,7 @@ pub fn progress_bar(progress: u16, total: u16, line_width: u16) -> Result<String
write!(line, "{}", red_part.red()).unwrap(); write!(line, "{}", red_part.red()).unwrap();
} }
write!(line, "] {progress:>3}/{total} exercises").unwrap(); writeln!(line, "] {progress:>3}/{total} exercises").unwrap();
Ok(line) Ok(line)
} }

View file

@ -149,6 +149,12 @@ You can keep working on this exercise or jump into the next one by removing the
let progress_bar = progress_bar(self.progress, self.exercises.len() as u16, line_width)?; let progress_bar = progress_bar(self.progress, self.exercises.len() as u16, line_width)?;
self.writer.write_all(progress_bar.as_bytes())?; self.writer.write_all(progress_bar.as_bytes())?;
self.writer.write_all(b"Current exercise: ")?;
self.writer.write_fmt(format_args!(
"{}",
self.exercise.path.to_string_lossy().bold()
))?;
self.show_prompt()?; self.show_prompt()?;
Ok(()) Ok(())