better print of search by word
This commit is contained in:
parent
8210cb37aa
commit
ca1c2005ea
@ -120,6 +120,13 @@ pub fn modify(header: &str) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_path(path: String) {
|
||||||
|
let off = path.find(".rnote/").unwrap_or(path.len()) + 7;
|
||||||
|
let mut path = path;
|
||||||
|
path.drain(..off);
|
||||||
|
println!("{}", path);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn search_by_word(word: &str) -> Result<()> {
|
pub fn search_by_word(word: &str) -> Result<()> {
|
||||||
extern crate fstream;
|
extern crate fstream;
|
||||||
let path = get_base_path()?;
|
let path = get_base_path()?;
|
||||||
@ -134,7 +141,7 @@ pub fn search_by_word(word: &str) -> Result<()> {
|
|||||||
if b {
|
if b {
|
||||||
let path = file.path().to_str().unwrap_or("");
|
let path = file.path().to_str().unwrap_or("");
|
||||||
if !path.is_empty() {
|
if !path.is_empty() {
|
||||||
println!("{}", path);
|
print_path(path.to_owned());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user