diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-07 16:21:38 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-07 16:21:38 +0000 |
| commit | 70e16f80b1fb3500454b7ae11db9db404b765216 (patch) | |
| tree | 2a66501fcb70037fbc6b80b498272d0fbfe60d7f /src/main.rs | |
| parent | Finished plugin system! (Added file opening) (diff) | |
| parent | chore(cleanup): Clean up project root (#135) (diff) | |
| download | sl0ppij-70e16f80b1fb3500454b7ae11db9db404b765216.tar.gz sl0ppij-70e16f80b1fb3500454b7ae11db9db404b765216.tar.xz sl0ppij-70e16f80b1fb3500454b7ae11db9db404b765216.zip | |
Merge in changes from main and fix a clippy lint
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/main.rs b/src/main.rs index 96809688..84dfac62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ mod tests; mod boundaries; +mod cli; mod command_is_executing; mod errors; mod input; @@ -31,6 +32,7 @@ use wasm_vm::PluginEnv; use wasmer::{ChainableNamedResolver, Instance, Module, Store, Value}; use wasmer_wasi::{Pipe, WasiState}; +use crate::cli::CliArgs; use crate::command_is_executing::CommandIsExecuting; use crate::errors::{ AppContext, ContextType, ErrorContext, PluginContext, PtyContext, ScreenContext, @@ -91,30 +93,8 @@ impl<T: Clone> SenderWithContext<T> { unsafe impl<T: Clone> Send for SenderWithContext<T> {} unsafe impl<T: Clone> Sync for SenderWithContext<T> {} -#[derive(StructOpt, Debug, Default)] -#[structopt(name = "mosaic")] -pub struct Opt { - #[structopt(short, long)] - /// Send "split (direction h == horizontal / v == vertical)" to active mosaic session - split: Option<char>, - #[structopt(short, long)] - /// Send "move focused pane" to active mosaic session - move_focus: bool, - #[structopt(short, long)] - /// Send "open file in new pane" to active mosaic session - open_file: Option<PathBuf>, - #[structopt(long)] - /// Maximum panes on screen, caution: opening more panes will close old ones - max_panes: Option<usize>, - #[structopt(short, long)] - /// Path to a layout yaml file - layout: Option<PathBuf>, - #[structopt(short, long)] - debug: bool, -} - pub fn main() { - let opts = Opt::from_args(); + let opts = CliArgs::from_args(); if let Some(split_dir) = opts.split { match split_dir { 'h' => { @@ -151,7 +131,7 @@ pub enum AppInstruction { Error(String), } -pub fn start(mut os_input: Box<dyn OsApi>, opts: Opt) { +pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) { let mut active_threads = vec![]; let command_is_executing = CommandIsExecuting::new(); |
