summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 7534bb1..2357ab2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use clap::Parser;
-use sshr::{Config, History, Session, SessionSource, Timestamp, Tmux};
+use sshr::{Config, History, Session, SessionSource, Tmux};
fn main() -> anyhow::Result<()> {
let config = Config::parse();
@@ -20,7 +20,10 @@ fn main() -> anyhow::Result<()> {
}
fn list_sessions(config: Config) -> anyhow::Result<()> {
- let mut sessions: HashMap<String, Timestamp> = HashMap::new();
+ let mut sessions = HashMap::new();
+
+ let ssh = ssh2::Session::new()?;
+ sessions = ssh.update(sessions)?;
let tmux = Tmux::new(config.socket_name);
sessions = tmux.update(sessions)?;
@@ -31,10 +34,7 @@ fn list_sessions(config: Config) -> anyhow::Result<()> {
}
}
- let mut sessions: Vec<Session> = sessions
- .into_iter()
- .map(|(name, timestamp)| Session { name, timestamp })
- .collect();
+ let mut sessions: Vec<Session> = sessions.into_values().collect();
sessions.sort();