aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 1260ee6f..dcc2537c 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -475,7 +475,7 @@ fn workspace_list(args: &[String]) -> std::io::Result<i32> {
fn workspace_create(args: &[String]) -> std::io::Result<i32> {
let mut cwd = None;
- let mut focus = true;
+ let mut focus = false;
let mut label = None;
let mut index = 0;
@@ -497,6 +497,10 @@ fn workspace_create(args: &[String]) -> std::io::Result<i32> {
label = Some(value.clone());
index += 2;
}
+ "--focus" => {
+ focus = true;
+ index += 1;
+ }
"--no-focus" => {
focus = false;
index += 1;
@@ -613,7 +617,7 @@ fn tab_list(args: &[String]) -> std::io::Result<i32> {
fn tab_create(args: &[String]) -> std::io::Result<i32> {
let mut workspace_id = None;
let mut cwd = None;
- let mut focus = true;
+ let mut focus = false;
let mut label = None;
let mut index = 0;
@@ -643,6 +647,10 @@ fn tab_create(args: &[String]) -> std::io::Result<i32> {
label = Some(value.clone());
index += 2;
}
+ "--focus" => {
+ focus = true;
+ index += 1;
+ }
"--no-focus" => {
focus = false;
index += 1;
@@ -844,7 +852,7 @@ fn pane_read(args: &[String]) -> std::io::Result<i32> {
fn pane_split(args: &[String]) -> std::io::Result<i32> {
let Some(raw_pane_id) = args.first() else {
eprintln!(
- "usage: herdr pane split <pane_id> --direction right|down [--cwd PATH] [--no-focus]"
+ "usage: herdr pane split <pane_id> --direction right|down [--cwd PATH] [--focus] [--no-focus]"
);
return Ok(2);
};
@@ -852,7 +860,7 @@ fn pane_split(args: &[String]) -> std::io::Result<i32> {
let pane_id = normalize_pane_id(raw_pane_id);
let mut direction = None;
let mut cwd = None;
- let mut focus = true;
+ let mut focus = false;
let mut index = 1;
while index < args.len() {
@@ -873,6 +881,10 @@ fn pane_split(args: &[String]) -> std::io::Result<i32> {
cwd = Some(value.clone());
index += 2;
}
+ "--focus" => {
+ focus = true;
+ index += 1;
+ }
"--no-focus" => {
focus = false;
index += 1;
@@ -1403,7 +1415,7 @@ fn print_status_help() {
fn print_workspace_help() {
eprintln!("herdr workspace commands:");
eprintln!(" herdr workspace list");
- eprintln!(" herdr workspace create [--cwd PATH] [--label TEXT] [--no-focus]");
+ eprintln!(" herdr workspace create [--cwd PATH] [--label TEXT] [--focus] [--no-focus]");
eprintln!(" herdr workspace get <workspace_id>");
eprintln!(" herdr workspace focus <workspace_id>");
eprintln!(" herdr workspace rename <workspace_id> <label>");
@@ -1414,7 +1426,7 @@ fn print_tab_help() {
eprintln!("herdr tab commands:");
eprintln!(" herdr tab list [--workspace <workspace_id>]");
eprintln!(
- " herdr tab create [--workspace <workspace_id>] [--cwd PATH] [--label TEXT] [--no-focus]"
+ " herdr tab create [--workspace <workspace_id>] [--cwd PATH] [--label TEXT] [--focus] [--no-focus]"
);
eprintln!(" herdr tab get <tab_id>");
eprintln!(" herdr tab focus <tab_id>");
@@ -1427,7 +1439,9 @@ fn print_pane_help() {
eprintln!(" herdr pane list [--workspace <workspace_id>]");
eprintln!(" herdr pane get <pane_id>");
eprintln!(" herdr pane read <pane_id> [--source visible|recent|recent-unwrapped] [--lines N] [--raw]");
- eprintln!(" herdr pane split <pane_id> --direction right|down [--cwd PATH] [--no-focus]");
+ eprintln!(
+ " herdr pane split <pane_id> --direction right|down [--cwd PATH] [--focus] [--no-focus]"
+ );
eprintln!(" herdr pane close <pane_id>");
eprintln!(" herdr pane send-text <pane_id> <text>");
eprintln!(" herdr pane send-keys <pane_id> <key> [key ...]");