forked from janek/mostr
fix(main): revamp prompt formatting
This commit is contained in:
parent
68d5c101e9
commit
be582cb536
21
src/main.rs
21
src/main.rs
|
@ -299,17 +299,16 @@ async fn main() {
|
||||||
let mut lines = stdin().lines();
|
let mut lines = stdin().lines();
|
||||||
loop {
|
loop {
|
||||||
println!();
|
println!();
|
||||||
selected_relay.as_ref().and_then(|url| relays.get(url)).inspect(|tasks| {
|
let tasks = selected_relay.as_ref().and_then(|url| relays.get(url)).unwrap_or(&local_tasks);
|
||||||
print!(
|
print!(
|
||||||
"{}",
|
"{} {}) ",
|
||||||
format!(
|
selected_relay.as_ref().map_or("TEMP".to_string(), |url| url.to_string()).bright_black().italic(),
|
||||||
"{} {}{}) ",
|
format!(
|
||||||
selected_relay.as_ref().map_or("local".to_string(), |url| url.to_string()),
|
"{}{}",
|
||||||
tasks.get_task_path(tasks.get_position()),
|
tasks.get_task_path(tasks.get_position()),
|
||||||
tasks.get_prompt_suffix()
|
tasks.get_prompt_suffix()
|
||||||
).italic()
|
).bold()
|
||||||
);
|
);
|
||||||
});
|
|
||||||
stdout().flush().unwrap();
|
stdout().flush().unwrap();
|
||||||
match lines.next() {
|
match lines.next() {
|
||||||
Some(Ok(input)) => {
|
Some(Ok(input)) => {
|
||||||
|
|
Loading…
Reference in New Issue