text section optimization
This commit is contained in:
parent
4fbb2b07c9
commit
444964d4ef
1 changed files with 56 additions and 59 deletions
115
src/help.rs
115
src/help.rs
|
@ -8,90 +8,87 @@ pub fn help(pargs: &mut Arguments) {
|
||||||
let topic = pargs.subcommand().unwrap();
|
let topic = pargs.subcommand().unwrap();
|
||||||
|
|
||||||
match topic.as_deref() {
|
match topic.as_deref() {
|
||||||
None => {
|
None =>
|
||||||
println!("remux v{VERSION}");
|
println!("remux v{VERSION}
|
||||||
println!("Valerie Wolfe <sleeplessval@gmail.com>");
|
Valerie Wolfe <sleeplessval@gmail.com>
|
||||||
println!("A command wrapper for tmux written in Rust.\n");
|
A command wrapper for tmux written in Rust.
|
||||||
|
|
||||||
println!("usage: remux <command> [<args>]\n");
|
usage: remux <command> [<args>]
|
||||||
|
|
||||||
println!("Commands:");
|
commands:
|
||||||
println!(" help Show help text for remux or a specific command");
|
help Show help text for remux or a specific command
|
||||||
println!(" attach Attach to an existing tmux session");
|
attach Attach to an existing tmux session
|
||||||
println!(" detach Detach clients from a tmux session");
|
detach Detach clients from a tmux session
|
||||||
println!(" has Check if a tmux session exists");
|
has Check if a tmux session exists
|
||||||
println!(" list Pretty-print all tmux sessions");
|
list Pretty-print all tmux sessions
|
||||||
println!(" new Create a new tmux session");
|
new Create a new tmux session
|
||||||
|
|
||||||
println!("\nUse 'remux help <command>' to see detailed help text for each command.");
|
|
||||||
},
|
|
||||||
|
|
||||||
|
Use 'remux help <command>' to see detailed help text for each command."),
|
||||||
|
|
||||||
Some("a" | "attach")
|
Some("a" | "attach")
|
||||||
=> {
|
=>
|
||||||
println!("remux attach");
|
println!("remux attach
|
||||||
println!("Attach to an existing session.\n");
|
Attach to an existing session.
|
||||||
|
|
||||||
println!("usage: remux attach [flags] <session> [window]\n");
|
usage: remux attach [flags] <session> [window]
|
||||||
|
remux a [flags] <session> [window]
|
||||||
|
|
||||||
println!("args:");
|
args:
|
||||||
println!(" <session> The session to attach to");
|
<session> The session to attach to
|
||||||
println!(" [window] Optionally focus a window in the given session\n");
|
[window] Optionally focus a window in the given session
|
||||||
|
|
||||||
println!("flags:");
|
flags:
|
||||||
println!(" -d, --detach Detach other attached clients from the session");
|
-d, --detach Detach other attached clients from the session
|
||||||
println!(" -n, --nest Attach the session inside another session.");
|
-n, --nest Attach the session inside another session.
|
||||||
println!(" -r, --readonly Attach the session as read-only");
|
-r, --readonly Attach the session as read-only"),
|
||||||
},
|
|
||||||
|
|
||||||
Some("d" | "detach")
|
Some("d" | "detach")
|
||||||
=> {
|
=>
|
||||||
println!("remux detach");
|
println!("remux detach
|
||||||
println!("Detach all clients from a session.\n");
|
Detach all clients from a session.
|
||||||
|
|
||||||
println!("usage: remux detach <session>\n");
|
usage: remux detach <session>
|
||||||
|
remux d <session>
|
||||||
|
|
||||||
println!("args:");
|
args:
|
||||||
println!(" <session> The session name to detach clients from");
|
<session> The session name to detach clients from"),
|
||||||
},
|
|
||||||
|
|
||||||
Some("has")
|
Some("has")
|
||||||
=> {
|
=>
|
||||||
println!("remux has");
|
println!("remux has
|
||||||
println!("Check if the target session exists.\n");
|
Check if the target session exists.
|
||||||
|
|
||||||
println!("usage: remux has [flags] <session>\n");
|
usage: remux has [flags] <session>
|
||||||
|
|
||||||
println!("args:");
|
args:
|
||||||
println!(" <session> The session to check for\n");
|
<session> The session to check for
|
||||||
|
|
||||||
println!("flags:");
|
flags:
|
||||||
println!(" -q, --quiet Display no text; exit code only");
|
-q, --quiet Display no text; exit code only"),
|
||||||
},
|
|
||||||
|
|
||||||
Some("l" | "ls" | "list")
|
Some("l" | "ls" | "list")
|
||||||
=> {
|
=>
|
||||||
println!("remux list");
|
println!("remux list
|
||||||
println!("Pretty-print all tmux sessions.\n");
|
Pretty-print all tmux sessions.
|
||||||
|
|
||||||
println!("usage: remux list");
|
usage: remux list
|
||||||
},
|
remux ls
|
||||||
|
remux l"),
|
||||||
|
|
||||||
Some("n" | "new")
|
Some("n" | "new")
|
||||||
=> {
|
=>
|
||||||
println!("remux new");
|
println!("remux new
|
||||||
println!("Create a new tmux session.\n");
|
Create a new tmux session.
|
||||||
|
|
||||||
println!("usage: remux new [flags] <title> [command]\n");
|
usage: remux new [flags] <title> [command]
|
||||||
|
|
||||||
println!("args:");
|
args:
|
||||||
println!(" <title> The title of the new session");
|
<title> The title of the new session
|
||||||
println!(" [command] The shell command to run\n");
|
[command] The shell command to run
|
||||||
|
|
||||||
println!("flags:");
|
flags:
|
||||||
println!(" -n, --nest Create the session inside another session.");
|
-n, --nest Create the session inside another session.
|
||||||
println!(" -t, --target <dir> Sets the target directory for the new session.");
|
-t, --target <dir> Sets the target directory for the new session."),
|
||||||
},
|
|
||||||
|
|
||||||
// not found
|
// not found
|
||||||
_ => error::no_help(topic.unwrap())
|
_ => error::no_help(topic.unwrap())
|
||||||
|
|
Loading…
Reference in a new issue