diff options
author | Toby Vincent <tobyv13@gmail.com> | 2023-03-20 01:58:49 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2023-03-20 01:59:28 -0500 |
commit | e11e8bbf14be8f84b57013e4ace1e61071853c12 (patch) | |
tree | 5518d4c5cd133929c10c59dbc004096610fc9793 /src/config.rs | |
parent | d17bdb1e841f9d39bd7c3142afc71ccb86bcc69d (diff) |
feat: impl tmux session switching writing to history file
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/config.rs b/src/config.rs index 7745e0b..30eac4b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,14 +1,12 @@ use std::path::PathBuf; -use clap::{Args, Parser}; +use clap::{Args, Parser, Subcommand}; use tracing::{metadata::LevelFilter, Level}; #[derive(Debug, Clone, Parser)] pub struct Config { - pub target: Option<String>, - - #[arg(short, long)] - pub list: bool, + #[command(subcommand)] + pub command: Commands, /// tmux socket-name, equivelent to `tmux -L <socket-name>` #[arg(short = 'L', long, default_value = "ssh")] @@ -22,6 +20,17 @@ pub struct Config { pub verbosity: Verbosity, } +#[derive(Debug, Clone, Subcommand)] +pub enum Commands { + /// List available session targets + List, + /// Switch to a specific session, or create it if it does not exist + Switch { + /// Target session name or ssh host + name: String, + }, +} + #[derive(Debug, Default, Clone, Args)] pub struct Verbosity { /// Print additional information per occurrence. |