diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-04-22 16:53:04 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2022-04-22 16:53:04 -0400 |
commit | 9cc4f10fdb3e31723289892be5929ccd0a1c48d7 (patch) | |
tree | 29fed413a9236b546b477a521e21eb6c9d2bf3f4 /src/context | |
parent | 763815418ac3acd56aa7e936c48861ae6e73ca40 (diff) |
combine --output-dir and --choosefiles into a single argument
--output-file is used for all output by joshuto
and can be specified what to output by:
`quit --output-current-directory`
`quit --output-selected-files`
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/app_context.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/context/app_context.rs b/src/context/app_context.rs index 4427611..b2b70e1 100644 --- a/src/context/app_context.rs +++ b/src/context/app_context.rs @@ -4,6 +4,7 @@ use std::sync::mpsc; use std::thread; use tui::layout::Rect; +use crate::commands::quit::QuitAction; use crate::config; use crate::context::{ CommandLineContext, LocalStateContext, MessageQueue, PreviewContext, TabContext, WorkerContext, @@ -16,22 +17,13 @@ use crate::Args; use notify::{RecursiveMode, Watcher}; use std::path; -#[derive(Clone, Copy, Debug, PartialEq)] -pub enum QuitType { - DoNot, - Normal, - Force, - ToCurrentDirectory, - ChooseFiles, -} - #[derive(Clone, Debug, PartialEq)] pub struct UiContext { pub layout: Vec<Rect>, } pub struct AppContext { - pub quit: QuitType, + pub quit: QuitAction, // event loop querying pub events: Events, // args from the command line @@ -81,7 +73,7 @@ impl AppContext { let watched_paths = HashSet::with_capacity(3); Self { - quit: QuitType::DoNot, + quit: QuitAction::DoNot, events, args, tab_context: TabContext::new(), |