add trash flag
This commit is contained in:
parent
1b69c3bf5c
commit
2e63774882
1 changed files with 9 additions and 5 deletions
14
src/app.rs
14
src/app.rs
|
|
@ -668,11 +668,15 @@ impl Application for App {
|
||||||
let mut commands = Vec::new();
|
let mut commands = Vec::new();
|
||||||
|
|
||||||
for arg in env::args().skip(1) {
|
for arg in env::args().skip(1) {
|
||||||
let location = match fs::canonicalize(&arg) {
|
let location = if &arg == "--trash" {
|
||||||
Ok(absolute) => Location::Path(absolute),
|
Location::Trash
|
||||||
Err(err) => {
|
} else {
|
||||||
log::warn!("failed to canonicalize {:?}: {}", arg, err);
|
match fs::canonicalize(&arg) {
|
||||||
continue;
|
Ok(absolute) => Location::Path(absolute),
|
||||||
|
Err(err) => {
|
||||||
|
log::warn!("failed to canonicalize {:?}: {}", arg, err);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
commands.push(app.open_tab(location));
|
commands.push(app.open_tab(location));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue