diff options
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. |