renamed 'root' command to 'path'

This commit is contained in:
Valerie Wolfe 2024-06-10 09:29:18 -04:00
parent 80a5c0a968
commit 2ccf9fa987
4 changed files with 12 additions and 11 deletions

View file

@ -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`
```

View file

@ -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()

View file

@ -23,7 +23,7 @@ commands:
list Pretty-print all tmux sessions
new Create a new tmux session
root print session path (session)
path print session path (session)
switch switch to another session (session)
Use 'remux help <command>' to see detailed help text for each command.
@ -103,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")
=>

View file

@ -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),