diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-07-19 21:28:05 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-07-19 21:28:05 -0400 |
commit | 12e63afdd0111918fcef426a3b00718411e8e7c3 (patch) | |
tree | 0cad15a52529b97c60411ab561f895f3fb664300 /src/commands | |
parent | a44601a414615b488b9814ea28f3cd6bd1086989 (diff) |
add --file-chooser option
- now if --output-file is not specified, output will be sent to stdout
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/open_file.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/commands/open_file.rs b/src/commands/open_file.rs index ad90a91..1799f60 100644 --- a/src/commands/open_file.rs +++ b/src/commands/open_file.rs @@ -1,7 +1,7 @@ use std::io; use std::path; -use crate::commands::reload; +use crate::commands::{quit, reload}; use crate::config::AppMimetypeEntry; use crate::context::AppContext; use crate::error::{JoshutoError, JoshutoErrorKind, JoshutoResult}; @@ -133,6 +133,10 @@ pub fn open(context: &mut AppContext, backend: &mut AppBackend) -> JoshutoResult reload::soft_reload(context.tab_context_ref().index, context)?; } Some(entry) => { + if context.args.file_chooser { + return quit::quit_with_action(context, quit::QuitAction::OutputSelectedFiles); + } + let paths = curr_list.map_or_else(Vec::new, |s| s.iter_selected().cloned().collect()); let (path, files) = if paths.is_empty() { (entry.file_path(), vec![entry.file_name()]) |