shell/zsh: add basic integration with fzf #30

Merged
pleshevskiy merged 2 commits from fzf into main 2022-08-19 16:41:12 +03:00
Showing only changes of commit bd4a581f3e - Show all commits

View file

@ -58,10 +58,10 @@ pub fn execute(repo: impl Repository, args: Args) {
Err(idx_err) => match first.parse::<PrintPart>() {
Ok(part) => (None, Some(part)),
Err(part_err) => {
return eprint!(
r#"error: Invalid value "{}": {}; {}"#,
first, idx_err, part_err
)
eprintln!("error: Invalid value {first:?}:");
eprintln!("- {idx_err}");
eprintln!("- {part_err}");
return;
}
},
}
@ -73,16 +73,16 @@ pub fn execute(repo: impl Repository, args: Args) {
let idx = match first.parse::<usize>() {
Ok(idx) => Some(idx),
Err(err) => return eprint!(r#"error: Invalid value "{}": {}"#, first, err),
Err(err) => return eprintln!("error: Invalid value {first:?}: {err}"),
};
let part = match second.parse::<PrintPart>() {
Ok(part) => Some(part),
Err(err) => return eprint!(r#"error: Invalid value "{}": {}"#, second, err),
Err(err) => return eprintln!("error: Invalid value {second:?}: {err}"),
};
(idx, part)
}
_ => return eprintln!("error: To much arguments: {}", args.rest.join(",")),
_ => return eprintln!("error: To much arguments: {:?}", args.rest),
};
let task = if let Some(idx) = idx {