mirror of
https://github.com/bobwen-dev/hunter
synced 2025-04-12 00:55:41 +02:00
add comments to proclist.rs
This commit is contained in:
parent
d23401c8ff
commit
752d6ab8f5
@ -59,10 +59,13 @@ impl Cmd {
|
|||||||
let cwd_pat = OsString::from("$s");
|
let cwd_pat = OsString::from("$s");
|
||||||
let cwd_files = self.cwd_files
|
let cwd_files = self.cwd_files
|
||||||
.take()
|
.take()
|
||||||
.unwrap()
|
.unwrap() // There always is a file, even if just place holder
|
||||||
.iter()
|
.iter()
|
||||||
.map(|file| file.strip_prefix(&self.cwd)
|
.map(|file|
|
||||||
|
// strip out the cwd part to make path shorter
|
||||||
|
file.strip_prefix(&self.cwd)
|
||||||
.into_os_string()
|
.into_os_string()
|
||||||
|
// escape single quotes so file names with them work
|
||||||
.escape_single_quote())
|
.escape_single_quote())
|
||||||
.collect::<Vec<OsString>>();
|
.collect::<Vec<OsString>>();
|
||||||
|
|
||||||
@ -82,8 +85,11 @@ impl Cmd {
|
|||||||
.fold(cmd, |cmd, (i, tab_files)| {
|
.fold(cmd, |cmd, (i, tab_files)| {
|
||||||
let tab_files_pat = OsString::from(format!("${}s", i));
|
let tab_files_pat = OsString::from(format!("${}s", i));
|
||||||
let tab_file_paths = tab_files.iter()
|
let tab_file_paths = tab_files.iter()
|
||||||
.map(|file| file.strip_prefix(&self.cwd)
|
.map(|file|
|
||||||
|
// strip out the cwd part to make path shorter
|
||||||
|
file.strip_prefix(&self.cwd)
|
||||||
.into_os_string()
|
.into_os_string()
|
||||||
|
// escape single quotes so file names with them work
|
||||||
.escape_single_quote())
|
.escape_single_quote())
|
||||||
.collect::<Vec<OsString>>();
|
.collect::<Vec<OsString>>();
|
||||||
|
|
||||||
@ -105,6 +111,7 @@ impl Cmd {
|
|||||||
let tab_path_pat = OsString::from(format!("${}", i));
|
let tab_path_pat = OsString::from(format!("${}", i));
|
||||||
let tab_path = tab_path.strip_prefix(&self.cwd)
|
let tab_path = tab_path.strip_prefix(&self.cwd)
|
||||||
.into_os_string()
|
.into_os_string()
|
||||||
|
// escape single quotes so file names with them work
|
||||||
.escape_single_quote();
|
.escape_single_quote();
|
||||||
|
|
||||||
cmd.iter().map(|part| {
|
cmd.iter().map(|part| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user