From 0fc6cd66c68ebbd687989f9d9aa7ad2bf4cd31c0 Mon Sep 17 00:00:00 2001 From: Valerie Date: Mon, 10 Jun 2024 12:03:40 -0400 Subject: [PATCH] renamed 'root' command to 'path' --- README.md | 6 +++--- src/command/session.rs | 6 +++--- src/help.rs | 8 ++++++-- src/main.rs | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2d8cd2a..a96eb7a 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,9 @@ tmux swi -t foo rmux s foo # cd to session path -tmux run 'printf "#{session_path}" > /tmp/tmux_root' -cd `cat /tmp/tmux_root` -cd `rmux root` +tmux run 'printf "#{session_path}" > /tmp/tmux_path' +cd `cat /tmp/tmux_path` +cd `rmux p` ``` diff --git a/src/command/session.rs b/src/command/session.rs index 3bd3584..ca33fa5 100644 --- a/src/command/session.rs +++ b/src/command/session.rs @@ -9,7 +9,7 @@ use tmux_interface::{ use crate::{ error, flag, util }; -const TMP_ROOT: &str = "/tmp/remux_root"; +const TMP_ROOT: &str = "/tmp/remux_path"; pub fn switch(pargs: &mut Arguments) { util::terminal_enforce(); @@ -36,8 +36,8 @@ pub fn switch(pargs: &mut Arguments) { .output().ok(); } -pub fn root() { - util::session_enforce("root"); +pub fn path() { + util::session_enforce("path"); let exec = commands::Run::new().shell_command("printf '#{session_path}' > ".to_string() + TMP_ROOT); Tmux::new() diff --git a/src/help.rs b/src/help.rs index 1cb3103..56d68b9 100644 --- a/src/help.rs +++ b/src/help.rs @@ -23,6 +23,9 @@ commands: list Pretty-print all tmux sessions new Create a new tmux session + path print session path (session) + switch switch to another session (session) + Use 'remux help ' to see detailed help text for each command. help topics: @@ -100,11 +103,12 @@ flags: Some("root") => -println!("remux root +println!("remux path Print the session path (#{{session_path}}) to standard output. Must be run from inside a session. -usage: remux root"), +usage: remux path + remux p"), Some("s" | "switch") => diff --git a/src/main.rs b/src/main.rs index bb72006..e94a42e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,8 +60,8 @@ fn main() { Some("n" | "new") => command::share::new(&mut args), - Some("root") - => command::session::root(), + Some("p" | "path") + => command::session::path(), Some("s" | "switch") => command::session::switch(&mut args),