Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Separate --force into --yes (prompts) and --force (removal) (#311)

Maximilian Roos1a9ce24f3634
diff --git a/.claude/rules/cli-output-formatting.md b/.claude/rules/cli-output-formatting.md
index f828f2295..1b0e22eaa 100644
--- a/.claude/rules/cli-output-formatting.md
+++ b/.claude/rules/cli-output-formatting.md
@@ -82,7 +82,7 @@ Use consistent punctuation and structure for related messages:
```rust
// Action; qualifier (flag)
"Removing feature worktree in background; retaining branch (--no-delete-branch)"
-"Commands approved; not saved (--force)"
+"Commands approved; not saved (--yes)"
```
**Ampersand for conjunctions:** Use `&` for combined actions:
@@ -179,7 +179,7 @@ each type.
| Hint ↳ | Info ○ |
| ----------------------------- | ------------------------------------- |
| "Run `wt merge` to continue" | "Already up to date with main" |
-| "Use `--force` to override" | "Skipping hooks (--no-verify)" |
+| "Use `--yes` to override" | "Skipping hooks (--no-verify)" |
| "Branch can be deleted" | "Worktree preserved (main worktree)" |
**Command suggestions in hints:** Use "To X, run Y" pattern. End with the
diff --git a/CLAUDE.md b/CLAUDE.md
index 5e3e3dbc9..dcf10ea02 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -31,6 +31,16 @@ Example of escalating instead of suppressing:
fn parse_config() { ... }
```
+## Data Safety
+
+Never risk data loss without explicit user consent. Err on the side of failing safely.
+
+- **Prefer failure over silent data loss** — If an operation might destroy untracked files, uncommitted changes, or user data, fail with an error rather than proceeding
+- **Explicit consent for destructive operations** — Operations that force-remove data (like `--force` on remove) require the user to explicitly request that behavior
+- **Time-of-check vs time-of-use** — If there's a gap between checking safety and performing an operation, be conservative. Example: `wt merge` verifies the worktree is clean before rebasing, but files could be added before cleanup — don't force-remove during cleanup
+
+A failed command that preserves data is always better than a "successful" command that silently destroys work.
+
## Terminology
Use consistent terminology in documentation, help text, and code comments:
diff --git a/docs/content/faq.md b/docs/content/faq.md
index ca6c1608f..7ef99e75a 100644
--- a/docs/content/faq.md
+++ b/docs/content/faq.md
@@ -34,7 +34,7 @@ Commands from project hooks require approval on first run. Approved commands are
<!-- END AUTO-GENERATED -->
-Use `--force` to bypass prompts (useful for CI/automation).
+Use `--yes` to bypass prompts (useful for CI/automation).
## How does Worktrunk compare to alternatives?
diff --git a/docs/content/hook.md b/docs/content/hook.md
index a35ab35de..4949bb15a 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -15,8 +15,8 @@ Hooks normally run automatically during `wt switch --create`, `wt merge`, and `w
Both user hooks (from `~/.config/worktrunk/config.toml`) and project hooks (from `.config/wt.toml`) are supported.
```bash
-wt hook pre-merge # Run pre-merge hooks
-wt hook pre-merge --force # Skip approval prompts (for CI)
+wt hook pre-merge # Run pre-merge hooks
+wt hook pre-merge --yes # Skip approval prompts (for CI)
```
## Hook types
@@ -210,7 +210,7 @@ Project commands require approval on first run:
- Approvals are saved to user config (`~/.config/worktrunk/config.toml`)
- If a command changes, new approval is required
-- Use `--force` to bypass prompts (useful for CI/automation)
+- Use `--yes` to bypass prompts (useful for CI/automation)
- Use `--no-verify` to skip hooks
Manage approvals with `wt hook approvals add` and `wt hook approvals clear`.
@@ -429,7 +429,7 @@ This prevents untrusted projects from running arbitrary commands.
- Project ID changes (repository moves)
**Bypassing prompts:**
-- `--force` flag on individual commands (e.g., `wt merge --force`)
+- `--yes` flag on individual commands (e.g., `wt merge --yes`)
- Useful for CI/automation where prompts aren't possible
### Examples
diff --git a/docs/content/merge.md b/docs/content/merge.md
index 698089938..28bf6da20 100644
--- a/docs/content/merge.md
+++ b/docs/content/merge.md
@@ -115,7 +115,7 @@ Usage: <b><span class=c>wt merge</span></b> <span class=c>[OPTIONS]</span> <span
<b><span class=c>--no-verify</span></b>
Skip hooks
- <b><span class=c>-f</span></b>, <b><span class=c>--force</span></b>
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
<b><span class=c>--stage</span></b><span class=c> &lt;STAGE&gt;</span>
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 9652fd4e6..e3345a3f7 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -92,11 +92,14 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>--no-verify</span></b>
Skip hooks
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
+ Skip approval prompts
+
<b><span class=c>-f</span></b>, <b><span class=c>--force</span></b>
- Force removal
+ Force worktree removal
- Skip approval prompts, and remove worktrees even if they contain
- untracked files (like build artifacts).
+ Remove worktrees even if they contain untracked files (like build
+ artifacts). Without this flag, removal fails if untracked files exist.
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
diff --git a/docs/content/switch.md b/docs/content/switch.md
index 5e470066b..a49394b87 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -106,7 +106,7 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
Arguments after <b>--</b> are passed to the command, so <b>wsc feature --</b>
&#39;implement login&#39; works.
- <b><span class=c>-f</span></b>, <b><span class=c>--force</span></b>
+ <b><span class=c>-y</span></b>, <b><span class=c>--yes</span></b>
Skip approval prompts
<b><span class=c>--clobber</span></b>
diff --git a/src/cli.rs b/src/cli.rs
index d1ee32379..1a7785363 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -230,7 +230,7 @@ wt config shell install zsh
```
Shows proposed changes and waits for confirmation before modifying any files.
-Use --force to skip confirmation."#)]
+Use --yes to skip confirmation."#)]
Install {
/// Shell to install (default: all)
#[arg(value_enum)]
@@ -238,7 +238,7 @@ Use --force to skip confirmation."#)]
/// Skip confirmation prompt
#[arg(short, long)]
- force: bool,
+ yes: bool,
/// Command name for shell integration (defaults to binary name)
///
@@ -264,7 +264,7 @@ wt config shell uninstall zsh
Skip confirmation prompt:
```console
-wt config shell uninstall --force
+wt config shell uninstall --yes
```
## Version tolerance
@@ -279,7 +279,7 @@ Detects various forms of the integration pattern regardless of:
/// Skip confirmation prompt
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Show output theme samples
@@ -866,7 +866,7 @@ pub enum StepCommand {
Commit {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
/// Skip hooks
#[arg(long = "no-verify", action = clap::ArgAction::SetFalse, default_value_t = true)]
@@ -895,7 +895,7 @@ pub enum StepCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
/// Skip hooks
#[arg(long = "no-verify", action = clap::ArgAction::SetFalse, default_value_t = true)]
@@ -1019,7 +1019,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Run post-start hooks
@@ -1032,7 +1032,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Run post-switch hooks
@@ -1045,7 +1045,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Run pre-commit hooks
@@ -1056,7 +1056,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Run pre-merge hooks
@@ -1067,7 +1067,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Run post-merge hooks
@@ -1078,7 +1078,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Run pre-remove hooks
@@ -1089,7 +1089,7 @@ pub enum HookCommand {
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
},
/// Manage command approvals
@@ -1108,7 +1108,7 @@ This prevents untrusted projects from running arbitrary commands.
- Project ID changes (repository moves)
**Bypassing prompts:**
-- `--force` flag on individual commands (e.g., `wt merge --force`)
+- `--yes` flag on individual commands (e.g., `wt merge --yes`)
- Useful for CI/automation where prompts aren't possible
## Examples
@@ -1457,8 +1457,8 @@ Hooks normally run automatically during `wt switch --create`, `wt merge`, and `w
Both user hooks (from `~/.config/worktrunk/config.toml`) and project hooks (from `.config/wt.toml`) are supported.
```console
-wt hook pre-merge # Run pre-merge hooks
-wt hook pre-merge --force # Skip approval prompts (for CI)
+wt hook pre-merge # Run pre-merge hooks
+wt hook pre-merge --yes # Skip approval prompts (for CI)
```
## Hook types
@@ -1652,7 +1652,7 @@ Project commands require approval on first run:
- Approvals are saved to user config (`~/.config/worktrunk/config.toml`)
- If a command changes, new approval is required
-- Use `--force` to bypass prompts (useful for CI/automation)
+- Use `--yes` to bypass prompts (useful for CI/automation)
- Use `--no-verify` to skip hooks
Manage approvals with `wt hook approvals add` and `wt hook approvals clear`.
@@ -2234,8 +2234,8 @@ wt switch --create fix --base=@ # Branch from current HEAD
execute_args: Vec<String>,
/// Skip approval prompts
- #[arg(short = 'f', long)]
- force: bool,
+ #[arg(short, long)]
+ yes: bool,
/// Remove stale paths at target
#[arg(long)]
@@ -2330,11 +2330,15 @@ Removal runs in the background by default (returns immediately). Logs are writte
#[arg(long = "no-verify", action = clap::ArgAction::SetFalse, default_value_t = true)]
verify: bool,
- /// Force removal
+ /// Skip approval prompts
+ #[arg(short, long)]
+ yes: bool,
+
+ /// Force worktree removal
///
- /// Skip approval prompts, and remove worktrees even if they contain
- /// untracked files (like build artifacts).
- #[arg(short = 'f', long)]
+ /// Remove worktrees even if they contain untracked files (like build
+ /// artifacts). Without this flag, removal fails if untracked files exist.
+ #[arg(short, long)]
force: bool,
},
@@ -2460,7 +2464,7 @@ lint = "cargo clippy"
/// Skip approval prompts
#[arg(short, long)]
- force: bool,
+ yes: bool,
/// What to stage before committing [default: all]
#[arg(long)]
diff --git a/src/commands/command_approval.rs b/src/commands/command_approval.rs
index 2bd5eb558..87ae01b25 100644
--- a/src/commands/command_approval.rs
+++ b/src/commands/command_approval.rs
@@ -42,7 +42,7 @@ pub fn approve_command_batch(
commands: &[HookCommand],
project_id: &str,
config: &WorktrunkConfig,
- force: bool,
+ yes: bool,
commands_already_filtered: bool,
) -> anyhow::Result<bool> {
let needs_approval: Vec<&HookCommand> = commands
@@ -57,7 +57,7 @@ pub fn approve_command_batch(
return Ok(true);
}
- let approved = if force {
+ let approved = if yes {
true
} else {
prompt_for_batch_approval(&needs_approval, project_id)?
@@ -67,8 +67,8 @@ pub fn approve_command_batch(
return Ok(false);
}
- // Only save approvals when interactively approved, not when using --force
- if !force {
+ // Only save approvals when interactively approved, not when using --yes
+ if !yes {
let mut fresh_config = WorktrunkConfig::load().context("Failed to reload config")?;
let project_entry = fresh_config
@@ -170,7 +170,7 @@ fn prompt_for_batch_approval(commands: &[&HookCommand], project_id: &str) -> any
/// # Example
///
/// ```ignore
-/// let ctx = CommandContext::new(&repo, &config, &branch, &worktree_path, &repo_root, force);
+/// let ctx = CommandContext::new(&repo, &config, &branch, &worktree_path, &repo_root, yes);
/// let approved = approve_hooks(&ctx, &[HookType::PostCreate, HookType::PostStart])?;
/// ```
pub fn approve_hooks(
@@ -207,5 +207,5 @@ pub fn approve_hooks_filtered(
}
let project_id = ctx.repo.project_identifier()?;
- approve_command_batch(&commands, project_id, ctx.config, ctx.force, false)
+ approve_command_batch(&commands, project_id, ctx.config, ctx.yes, false)
}
diff --git a/src/commands/command_executor.rs b/src/commands/command_executor.rs
index c3478446e..8dacfeb1d 100644
--- a/src/commands/command_executor.rs
+++ b/src/commands/command_executor.rs
@@ -20,7 +20,7 @@ pub struct CommandContext<'a> {
pub branch: Option<&'a str>,
pub worktree_path: &'a Path,
pub repo_root: &'a Path,
- pub force: bool,
+ pub yes: bool,
}
impl<'a> CommandContext<'a> {
@@ -30,7 +30,7 @@ impl<'a> CommandContext<'a> {
branch: Option<&'a str>,
worktree_path: &'a Path,
repo_root: &'a Path,
- force: bool,
+ yes: bool,
) -> Self {
Self {
repo,
@@ -38,7 +38,7 @@ impl<'a> CommandContext<'a> {
branch,
worktree_path,
repo_root,
- force,
+ yes,
}
}
diff --git a/src/commands/configure_shell.rs b/src/commands/configure_shell.rs
index 83be5761f..08ba81f4b 100644
--- a/src/commands/configure_shell.rs
+++ b/src/commands/configure_shell.rs
@@ -140,14 +140,14 @@ pub fn handle_configure_shell(
});
}
- // Show what will be done and ask for confirmation (unless --force flag is used)
+ // Show what will be done and ask for confirmation (unless --yes flag is used)
if !skip_confirmation
&& !prompt_for_confirmation(&preview.configured, &completion_preview, &cmd)?
{
return Err("Cancelled by user".to_string());
}
- // User confirmed (or --force flag was used), now actually apply the changes
+ // User confirmed (or --yes flag was used), now actually apply the changes
let result = scan_shell_configs(shell_filter, false, &cmd)?;
let completion_results = process_shell_completions(&shells, false, &cmd)?;
@@ -671,14 +671,14 @@ pub fn handle_unconfigure_shell(
return Ok(preview);
}
- // Show what will be done and ask for confirmation (unless --force flag is used)
+ // Show what will be done and ask for confirmation (unless --yes flag is used)
if !skip_confirmation
&& !prompt_for_uninstall_confirmation(&preview.results, &preview.completion_results)?
{
return Err("Cancelled by user".to_string());
}
- // User confirmed (or --force flag was used), now actually apply the changes
+ // User confirmed (or --yes flag was used), now actually apply the changes
scan_for_uninstall(shell_filter, false, cmd)
}
diff --git a/src/commands/context.rs b/src/commands/context.rs
index 99c4a44f1..7be7eb7aa 100644
--- a/src/commands/context.rs
+++ b/src/commands/context.rs
@@ -74,14 +74,14 @@ impl CommandEnv {
}
/// Build a `CommandContext` tied to this environment.
- pub fn context(&self, force: bool) -> CommandContext<'_> {
+ pub fn context(&self, yes: bool) -> CommandContext<'_> {
CommandContext::new(
&self.repo,
&self.config,
self.branch.as_deref(),
&self.worktree_path,
&self.repo_root,
- force,
+ yes,
)
}
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 7cb7c0665..59da2bf32 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -20,7 +20,7 @@ pub struct MergeOptions<'a> {
pub rebase: bool,
pub remove: bool,
pub verify: bool,
- pub force: bool,
+ pub yes: bool,
pub stage_mode: super::commit::StageMode,
}
@@ -93,7 +93,7 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
rebase,
remove,
verify,
- force,
+ yes,
stage_mode,
} = opts;
@@ -136,7 +136,7 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
.collect()?;
// Approve all commands in a single batch (shows templates, not expanded values)
- let approved = approve_command_batch(&all_commands, &project_id, config, force, false)?;
+ let approved = approve_command_batch(&all_commands, &project_id, config, yes, false)?;
// If commands were declined, skip hooks but continue with merge
// Shadow verify to gate all subsequent hook execution on approval
@@ -152,7 +152,7 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
if squash_enabled {
false // Squash path handles staging and committing
} else {
- let ctx = env.context(force);
+ let ctx = env.context(yes);
let mut options = CommitOptions::new(&ctx);
options.target_branch = Some(&target_branch);
options.no_verify = !verify;
@@ -172,7 +172,7 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
matches!(
super::standalone::handle_squash(
Some(&target_branch),
- force,
+ yes,
!verify, // skip_pre_commit when !verify
stage_mode
)?,
@@ -203,7 +203,7 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
// Run pre-merge checks unless --no-verify was specified
// Do this after commit/squash/rebase to validate the final state that will be pushed
if verify {
- let ctx = env.context(force);
+ let ctx = env.context(yes);
let project_config = repo.load_project_config()?.unwrap_or_default();
run_pre_merge_commands(&project_config, &ctx, &target_branch, None)?;
}
@@ -246,9 +246,9 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
deletion_mode: BranchDeletionMode::SafeDelete,
target_branch: Some(target_branch.clone()),
integration_reason,
- // After a successful merge, force removal since any untracked files
- // (build artifacts) are no longer needed
- force_worktree: true,
+ // Don't force removal - if worktree has untracked files added after
+ // commit, removal will fail and user can run `wt remove --force`
+ force_worktree: false,
};
// Run hooks during merge removal (pass through verify flag)
// Approval was handled at the gate (MergeCommandCollector)
@@ -278,7 +278,7 @@ pub fn handle_merge(opts: MergeOptions<'_>) -> anyhow::Result<()> {
Some(&current_branch),
&destination_path,
&destination_repo_root,
- force,
+ yes,
);
execute_post_merge_commands(&ctx, &target_branch, None)?;
}
diff --git a/src/commands/standalone.rs b/src/commands/standalone.rs
index 64b652ee8..f6c99c229 100644
--- a/src/commands/standalone.rs
+++ b/src/commands/standalone.rs
@@ -26,13 +26,13 @@ use super::repository_ext::RepositoryCliExt;
/// There's no skip flag - if you explicitly run hooks, all configured hooks run.
///
/// Works in detached HEAD state - `{{ branch }}` template variable will be "HEAD".
-pub fn run_hook(hook_type: HookType, force: bool, name_filter: Option<&str>) -> anyhow::Result<()> {
+pub fn run_hook(hook_type: HookType, yes: bool, name_filter: Option<&str>) -> anyhow::Result<()> {
use super::command_approval::approve_hooks_filtered;
// Derive context from current environment (branch-optional for CI compatibility)
let env = CommandEnv::for_action_branchless()?;
let repo = &env.repo;
- let ctx = env.context(force);
+ let ctx = env.context(yes);
// Load project config (optional - user hooks can run without project config)
let project_config = repo.load_project_config()?;
@@ -161,7 +161,7 @@ pub fn run_hook(hook_type: HookType, force: bool, name_filter: Option<&str>) ->
/// Handle `wt step commit` command
pub fn step_commit(
- force: bool,
+ yes: bool,
no_verify: bool,
stage_mode: super::commit::StageMode,
show_prompt: bool,
@@ -177,7 +177,7 @@ pub fn step_commit(
}
let env = CommandEnv::for_action("commit")?;
- let ctx = env.context(force);
+ let ctx = env.context(yes);
// "Approve at the Gate": approve pre-commit hooks upfront (unless --no-verify)
// Shadow no_verify: if user declines approval, skip hooks but continue commit
@@ -225,7 +225,7 @@ pub enum SquashResult {
/// * `stage_mode` - What to stage before committing (All or Tracked; None not supported for squash)
pub fn handle_squash(
target: Option<&str>,
- force: bool,
+ yes: bool,
skip_pre_commit: bool,
stage_mode: super::commit::StageMode,
) -> anyhow::Result<SquashResult> {
@@ -235,7 +235,7 @@ pub fn handle_squash(
let repo = &env.repo;
// Squash requires being on a branch (can't squash in detached HEAD)
let current_branch = env.require_branch("squash")?.to_string();
- let ctx = env.context(force);
+ let ctx = env.context(yes);
let generator = CommitGenerator::new(&env.config.commit_generation);
// Get target branch (default to default branch if not provided)
@@ -594,7 +594,7 @@ pub fn add_approvals(show_all: bool) -> anyhow::Result<()> {
commands
};
- // Call the approval prompt (force=false to require interactive approval and save)
+ // Call the approval prompt (yes=false to require interactive approval and save)
// When show_all=true, we've already included all commands in commands_to_approve
// When show_all=false, we've already filtered to unapproved commands
// So we pass skip_approval_filter=true to prevent double-filtering
diff --git a/src/git/error.rs b/src/git/error.rs
index 744976027..b7079d037 100644
--- a/src/git/error.rs
+++ b/src/git/error.rs
@@ -435,7 +435,7 @@ impl std::fmt::Display for GitError {
"{}\n{}",
error_message("Cannot prompt for approval in non-interactive environment"),
hint_message(cformat!(
- "To skip prompts in CI/CD, add <bright-black>--force</>; to pre-approve commands, run <bright-black>{approvals_cmd}</>"
+ "To skip prompts in CI/CD, add <bright-black>--yes</>; to pre-approve commands, run <bright-black>{approvals_cmd}</>"
))
)
}
@@ -1050,7 +1050,7 @@ mod tests {
let err = GitError::NotInteractive;
let display = err.to_string();
assert!(display.contains("non-interactive"));
- assert!(display.contains("--force"));
+ assert!(display.contains("--yes"));
}
#[test]
diff --git a/src/main.rs b/src/main.rs
index a4a290a95..045a21070 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -709,10 +709,10 @@ fn main() {
let cmd = cmd.unwrap_or_else(binary_name);
handle_init(shell, cmd).map_err(|e| anyhow::anyhow!("{}", e))
}
- ConfigShellCommand::Install { shell, force, cmd } => {
+ ConfigShellCommand::Install { shell, yes, cmd } => {
// Auto-write to shell config files and completions
let cmd = cmd.unwrap_or_else(binary_name);
- handle_configure_shell(shell, force, cmd)
+ handle_configure_shell(shell, yes, cmd)
.map_err(|e| anyhow::anyhow!("{}", e))
.and_then(|scan_result| {
@@ -855,9 +855,9 @@ fn main() {
Ok(())
})
}
- ConfigShellCommand::Uninstall { shell, force } => {
+ ConfigShellCommand::Uninstall { shell, yes } => {
let explicit_shell = shell.is_some();
- handle_unconfigure_shell(shell, force, &binary_name())
+ handle_unconfigure_shell(shell, yes, &binary_name())
.map_err(|e| anyhow::anyhow!("{}", e))
.and_then(|scan_result| {
let shell_count = scan_result.results.len();
@@ -1041,7 +1041,7 @@ fn main() {
},
Commands::Step { action } => match action {
StepCommand::Commit {
- force,
+ yes,
verify,
stage,
show_prompt,
@@ -1051,11 +1051,11 @@ fn main() {
let stage_final = stage
.or_else(|| config.commit.and_then(|c| c.stage))
.unwrap_or_default();
- step_commit(force, !verify, stage_final, show_prompt)
+ step_commit(yes, !verify, stage_final, show_prompt)
}),
StepCommand::Squash {
target,
- force,
+ yes,
verify,
stage,
show_prompt,
@@ -1080,7 +1080,7 @@ fn main() {
use commands::command_approval::approve_hooks;
use commands::context::CommandEnv;
let env = CommandEnv::for_action("squash")?;
- let ctx = env.context(force);
+ let ctx = env.context(yes);
let approved = approve_hooks(&ctx, &[HookType::PreCommit])?;
if !approved {
crate::output::print(info_message(
@@ -1092,7 +1092,7 @@ fn main() {
false
};
- match handle_squash(target.as_deref(), force, !verify, stage_final)? {
+ match handle_squash(target.as_deref(), yes, !verify, stage_final)? {
SquashResult::Squashed | SquashResult::NoNetChanges => {}
SquashResult::NoCommitsAhead(branch) => {
crate::output::print(info_message(format!(
@@ -1126,26 +1126,26 @@ fn main() {
hook_type,
expanded,
} => handle_hook_show(hook_type.as_deref(), expanded),
- HookCommand::PostCreate { name, force } => {
- run_hook(HookType::PostCreate, force, name.as_deref())
+ HookCommand::PostCreate { name, yes } => {
+ run_hook(HookType::PostCreate, yes, name.as_deref())
}
- HookCommand::PostStart { name, force } => {
- run_hook(HookType::PostStart, force, name.as_deref())
+ HookCommand::PostStart { name, yes } => {
+ run_hook(HookType::PostStart, yes, name.as_deref())
}
- HookCommand::PostSwitch { name, force } => {
- run_hook(HookType::PostSwitch, force, name.as_deref())
+ HookCommand::PostSwitch { name, yes } => {
+ run_hook(HookType::PostSwitch, yes, name.as_deref())
}
- HookCommand::PreCommit { name, force } => {
- run_hook(HookType::PreCommit, force, name.as_deref())
+ HookCommand::PreCommit { name, yes } => {
+ run_hook(HookType::PreCommit, yes, name.as_deref())
}
- HookCommand::PreMerge { name, force } => {
- run_hook(HookType::PreMerge, force, name.as_deref())
+ HookCommand::PreMerge { name, yes } => {
+ run_hook(HookType::PreMerge, yes, name.as_deref())
}
- HookCommand::PostMerge { name, force } => {
- run_hook(HookType::PostMerge, force, name.as_deref())
+ HookCommand::PostMerge { name, yes } => {
+ run_hook(HookType::PostMerge, yes, name.as_deref())
}
- HookCommand::PreRemove { name, force } => {
- run_hook(HookType::PreRemove, force, name.as_deref())
+ HookCommand::PreRemove { name, yes } => {
+ run_hook(HookType::PreRemove, yes, name.as_deref())
}
HookCommand::Approvals { action } => match action {
ApprovalsCommand::Add { all } => add_approvals(all),
@@ -1215,7 +1215,7 @@ fn main() {
base,
execute,
execute_args,
- force,
+ yes,
clobber,
verify,
} => WorktrunkConfig::load()
@@ -1235,7 +1235,7 @@ fn main() {
Some(&branch),
&worktree_path,
&repo_root,
- force,
+ yes,
);
// Approve different hooks based on whether we're creating or switching
if create {
@@ -1272,7 +1272,7 @@ fn main() {
&branch,
create,
base.as_deref(),
- force,
+ yes,
clobber,
skip_hooks,
&config,
@@ -1293,7 +1293,7 @@ fn main() {
Some(branch_info.branch()),
result.path(),
&repo_root,
- force,
+ yes,
);
// Post-switch runs first (immediate "I'm here" signal)
@@ -1329,6 +1329,7 @@ fn main() {
force_delete,
background,
verify,
+ yes,
force,
} => WorktrunkConfig::load()
.context("Failed to load config")
@@ -1362,7 +1363,7 @@ fn main() {
current_branch,
&worktree_path,
&repo_root,
- force,
+ yes,
);
let approved =
approve_hooks(&ctx, &[HookType::PreRemove, HookType::PostSwitch])?;
@@ -1505,7 +1506,7 @@ fn main() {
no_remove,
verify,
no_verify,
- force,
+ yes,
stage,
} => WorktrunkConfig::load()
.context("Failed to load config")
@@ -1546,7 +1547,7 @@ fn main() {
rebase: rebase_final,
remove: remove_final,
verify: verify_final,
- force,
+ yes,
stage_mode: stage_final,
})
}),
diff --git a/tests/CLAUDE.md b/tests/CLAUDE.md
index c1687f72d..154cd5bc2 100644
--- a/tests/CLAUDE.md
+++ b/tests/CLAUDE.md
@@ -49,7 +49,7 @@ assert!(!marker_file.exists(), "Command should NOT have run");
## Testing with --execute Commands
-Use `--force` to skip interactive prompts in tests. Don't pipe input to stdin.
+Use `--yes` to skip interactive prompts in tests. Don't pipe input to stdin.
## README Examples and Snapshot Testing
diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rs
index 9a1fba639..d2d311468 100644
--- a/tests/integration_tests/approval_ui.rs
+++ b/tests/integration_tests/approval_ui.rs
@@ -114,12 +114,8 @@ fn test_force_flag_does_not_save_approvals(repo: TestRepo) {
// Run with --force
let settings = setup_snapshot_settings(&repo);
settings.bind(|| {
- let mut cmd = make_snapshot_cmd(
- &repo,
- "switch",
- &["--create", "test-force", "--force"],
- None,
- );
+ let mut cmd =
+ make_snapshot_cmd(&repo, "switch", &["--create", "test-force", "--yes"], None);
assert_cmd_snapshot!("force_does_not_save_approvals_first_run", cmd);
});
@@ -128,7 +124,7 @@ fn test_force_flag_does_not_save_approvals(repo: TestRepo) {
repo.clean_cli_env(&mut cmd);
cmd.arg("remove")
.arg("test-force")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
cmd.output().unwrap();
@@ -321,7 +317,7 @@ fn test_force_bypasses_tty_check(repo: TestRepo) {
let mut cmd = make_snapshot_cmd(
&repo,
"switch",
- &["--create", "test-force-tty", "--force"],
+ &["--create", "test-force-tty", "--yes"],
None,
);
assert_cmd_snapshot!("force_bypasses_tty_check", cmd);
@@ -346,7 +342,7 @@ fn test_hook_post_merge_target_is_current_branch(repo: TestRepo) {
// Run the hook with --force to skip approval
let output = Command::new(env!("CARGO_BIN_EXE_wt"))
- .args(["hook", "post-merge", "--force"])
+ .args(["hook", "post-merge", "--yes"])
.current_dir(repo.root_path())
.env("NO_COLOR", "1")
.output()
@@ -383,7 +379,7 @@ fn test_hook_pre_merge_target_is_current_branch(repo: TestRepo) {
// Run the hook with --force to skip approval
let output = Command::new(env!("CARGO_BIN_EXE_wt"))
- .args(["hook", "pre-merge", "--force"])
+ .args(["hook", "pre-merge", "--yes"])
.current_dir(repo.root_path())
.env("NO_COLOR", "1")
.output()
@@ -421,7 +417,7 @@ build = "echo 'running build' > build.txt"
// Run only the "lint" command with --force to skip approval
let output = Command::new(env!("CARGO_BIN_EXE_wt"))
- .args(["hook", "pre-merge", "lint", "--force"])
+ .args(["hook", "pre-merge", "lint", "--yes"])
.current_dir(repo.root_path())
.env("NO_COLOR", "1")
.output()
@@ -463,12 +459,8 @@ lint = "echo 'lint'"
// Run with a name that doesn't exist
let settings = setup_snapshot_settings(&repo);
settings.bind(|| {
- let mut cmd = make_snapshot_cmd(
- &repo,
- "hook",
- &["pre-merge", "nonexistent", "--force"],
- None,
- );
+ let mut cmd =
+ make_snapshot_cmd(&repo, "hook", &["pre-merge", "nonexistent", "--yes"], None);
assert_cmd_snapshot!("step_hook_unknown_name_error", cmd);
});
}
@@ -483,7 +475,7 @@ fn test_step_hook_name_filter_on_unnamed_command(repo: TestRepo) {
// Run with a name filter on a hook that has no named commands
let settings = setup_snapshot_settings(&repo);
settings.bind(|| {
- let mut cmd = make_snapshot_cmd(&repo, "hook", &["pre-merge", "test", "--force"], None);
+ let mut cmd = make_snapshot_cmd(&repo, "hook", &["pre-merge", "test", "--yes"], None);
assert_cmd_snapshot!("step_hook_name_filter_on_unnamed", cmd);
});
}
@@ -503,7 +495,7 @@ third = "echo 'third' >> output.txt"
// Run without name filter (all commands should run)
let output = Command::new(env!("CARGO_BIN_EXE_wt"))
- .args(["hook", "pre-merge", "--force"])
+ .args(["hook", "pre-merge", "--yes"])
.current_dir(repo.root_path())
.env("NO_COLOR", "1")
.output()
diff --git a/tests/integration_tests/completion.rs b/tests/integration_tests/completion.rs
index 7270a5ea3..4a07488ca 100644
--- a/tests/integration_tests/completion.rs
+++ b/tests/integration_tests/completion.rs
@@ -931,7 +931,7 @@ fn test_complete_merge_with_flags(repo: TestRepo) {
// Test: wt merge --no-remove --force <cursor>
// Should complete branches for positional (boolean flags don't consume arguments)
let output = repo
- .completion_cmd(&["wt", "merge", "--no-remove", "--force", ""])
+ .completion_cmd(&["wt", "merge", "--no-remove", "--yes", ""])
.output()
.unwrap();
diff --git a/tests/integration_tests/configure_shell.rs b/tests/integration_tests/configure_shell.rs
index 0f7953f90..ce717e69d 100644
--- a/tests/integration_tests/configure_shell.rs
+++ b/tests/integration_tests/configure_shell.rs
@@ -24,7 +24,7 @@ fn test_configure_shell_with_yes(repo: TestRepo, temp_home: TempDir) {
cmd.arg("config")
.arg("shell")
.arg("install")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -68,7 +68,7 @@ fn test_configure_shell_specific_shell(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("install")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -112,7 +112,7 @@ fn test_configure_shell_already_exists(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("install")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -145,7 +145,7 @@ fn test_configure_shell_fish(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("install")
.arg("fish")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -198,7 +198,7 @@ fn test_configure_shell_fish_extension_exists(repo: TestRepo, temp_home: TempDir
.arg("shell")
.arg("install")
.arg("fish")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
// Fish completions are inline in the init script, so when extension exists,
@@ -258,7 +258,7 @@ fn test_configure_shell_fish_all_already_configured(repo: TestRepo, temp_home: T
.arg("shell")
.arg("install")
.arg("fish")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
// Both extension and completions already exist
@@ -278,7 +278,7 @@ fn test_configure_shell_no_files(repo: TestRepo, temp_home: TempDir) {
cmd.arg("config")
.arg("shell")
.arg("install")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -315,7 +315,7 @@ fn test_configure_shell_multiple_configs(repo: TestRepo, temp_home: TempDir) {
cmd.arg("config")
.arg("shell")
.arg("install")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -375,7 +375,7 @@ fn test_configure_shell_mixed_states(repo: TestRepo, temp_home: TempDir) {
cmd.arg("config")
.arg("shell")
.arg("install")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -431,7 +431,7 @@ fn test_uninstall_shell(repo: TestRepo, temp_home: TempDir) {
cmd.arg("config")
.arg("shell")
.arg("uninstall")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -488,7 +488,7 @@ fn test_uninstall_shell_multiple(repo: TestRepo, temp_home: TempDir) {
cmd.arg("config")
.arg("shell")
.arg("uninstall")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -538,7 +538,7 @@ fn test_uninstall_shell_not_found(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("uninstall")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -575,7 +575,7 @@ fn test_uninstall_shell_fish(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("uninstall")
.arg("fish")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -616,7 +616,7 @@ fn test_install_uninstall_roundtrip(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("install")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
let output = cmd.output().expect("Failed to execute command");
@@ -637,7 +637,7 @@ fn test_install_uninstall_roundtrip(repo: TestRepo, temp_home: TempDir) {
.arg("shell")
.arg("uninstall")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
let output = cmd.output().expect("Failed to execute command");
@@ -675,7 +675,7 @@ fn test_install_uninstall_no_blank_line_accumulation(repo: TestRepo, temp_home:
repo.clean_cli_env(&mut cmd);
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env("SHELL", "/bin/zsh");
- cmd.args(["config", "shell", "install", "zsh", "--force"]);
+ cmd.args(["config", "shell", "install", "zsh", "--yes"]);
cmd.current_dir(repo.root_path());
let output = cmd.output().expect("Failed to execute command");
assert!(output.status.success(), "Install should succeed");
@@ -693,7 +693,7 @@ fn test_install_uninstall_no_blank_line_accumulation(repo: TestRepo, temp_home:
repo.clean_cli_env(&mut cmd);
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env("SHELL", "/bin/zsh");
- cmd.args(["config", "shell", "uninstall", "zsh", "--force"]);
+ cmd.args(["config", "shell", "uninstall", "zsh", "--yes"]);
cmd.current_dir(repo.root_path());
let output = cmd.output().expect("Failed to execute command");
assert!(output.status.success(), "Uninstall should succeed");
@@ -711,7 +711,7 @@ fn test_install_uninstall_no_blank_line_accumulation(repo: TestRepo, temp_home:
repo.clean_cli_env(&mut cmd);
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env("SHELL", "/bin/zsh");
- cmd.args(["config", "shell", "install", "zsh", "--force"]);
+ cmd.args(["config", "shell", "install", "zsh", "--yes"]);
cmd.current_dir(repo.root_path());
let output = cmd.output().expect("Failed to execute command");
assert!(output.status.success(), "Re-install should succeed");
@@ -753,7 +753,7 @@ fn test_configure_shell_no_warning_when_compinit_enabled(repo: TestRepo, temp_ho
.arg("shell")
.arg("install")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
assert_cmd_snapshot!(cmd, @"
@@ -789,7 +789,7 @@ fn test_configure_shell_no_warning_for_bash_user(repo: TestRepo, temp_home: Temp
cmd.arg("config")
.arg("shell")
.arg("install")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
// Should NOT show compinit warning - user is a bash user, not zsh
@@ -827,7 +827,7 @@ fn test_configure_shell_no_warning_for_fish_install(repo: TestRepo, temp_home: T
.arg("shell")
.arg("install")
.arg("fish") // Specifically installing fish, not zsh
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
// Should NOT show compinit warning - we're installing fish, not zsh
@@ -866,7 +866,7 @@ fn test_configure_shell_no_warning_when_already_configured(repo: TestRepo, temp_
.arg("shell")
.arg("install")
.arg("zsh")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
// Should NOT show compinit warning - zsh is AlreadyExists, not newly added
@@ -900,7 +900,7 @@ fn test_configure_shell_no_warning_when_shell_unset(repo: TestRepo, temp_home: T
cmd.arg("config")
.arg("shell")
.arg("install")
- .arg("--force")
+ .arg("--yes")
.current_dir(repo.root_path());
// Should NOT show compinit warning - can't determine user's shell
diff --git a/tests/integration_tests/merge.rs b/tests/integration_tests/merge.rs
index 613b6621c..15de34198 100644
--- a/tests/integration_tests/merge.rs
+++ b/tests/integration_tests/merge.rs
@@ -603,7 +603,7 @@ fn test_merge_pre_merge_command_success(mut repo: TestRepo) {
snapshot_merge(
"merge_pre_merge_command_success",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -625,7 +625,7 @@ fn test_merge_pre_merge_command_failure(mut repo: TestRepo) {
snapshot_merge(
"merge_pre_merge_command_failure",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -678,7 +678,7 @@ test = "exit 0"
snapshot_merge(
"merge_pre_merge_command_named",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -704,7 +704,7 @@ fn test_merge_post_merge_command_success(mut repo: TestRepo) {
snapshot_merge(
"merge_post_merge_command_success",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
@@ -743,7 +743,7 @@ fn test_merge_post_merge_command_skipped_with_no_verify(mut repo: TestRepo) {
snapshot_merge(
"merge_post_merge_command_no_verify",
&repo,
- &["main", "--force", "--no-verify"],
+ &["main", "--yes", "--no-verify"],
Some(&feature_wt),
);
@@ -772,7 +772,7 @@ fn test_merge_post_merge_command_failure(mut repo: TestRepo) {
snapshot_merge(
"merge_post_merge_command_failure",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -802,7 +802,7 @@ deploy = "echo 'Deploying branch {{ branch }}' > deploy.txt"
snapshot_merge(
"merge_post_merge_command_named",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
@@ -844,7 +844,7 @@ fn test_merge_post_merge_runs_with_nothing_to_merge(mut repo: TestRepo) {
snapshot_merge(
"merge_post_merge_runs_with_nothing_to_merge",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
@@ -875,7 +875,7 @@ fn test_merge_post_merge_runs_from_main_branch(repo: TestRepo) {
snapshot_merge(
"merge_post_merge_runs_from_main_branch",
&repo,
- &["--force"],
+ &["--yes"],
None, // cwd = repo root = main branch
);
@@ -911,7 +911,7 @@ fn test_merge_pre_commit_command_success(mut repo: TestRepo) {
snapshot_merge(
"merge_pre_commit_command_success",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -936,7 +936,7 @@ fn test_merge_pre_commit_command_failure(mut repo: TestRepo) {
snapshot_merge(
"merge_pre_commit_command_failure",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -964,7 +964,7 @@ fn test_merge_pre_squash_command_success(mut repo: TestRepo) {
snapshot_merge(
"merge_pre_squash_command_success",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -986,7 +986,7 @@ fn test_merge_pre_squash_command_failure(mut repo: TestRepo) {
snapshot_merge(
"merge_pre_squash_command_failure",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
);
}
@@ -1283,7 +1283,7 @@ command = "{}"
snapshot_merge_with_env(
"readme_example_complex",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
&[("PATH", &path_with_bin)],
);
@@ -1367,8 +1367,7 @@ fi
let settings = setup_snapshot_settings(&repo);
settings.bind(|| {
- let mut cmd =
- make_snapshot_cmd(&repo, "switch", &["--create", "feature-x", "--force"], None);
+ let mut cmd = make_snapshot_cmd(&repo, "switch", &["--create", "feature-x", "--yes"], None);
cmd.env("PATH", &path_with_bin);
assert_cmd_snapshot!("readme_example_hooks_post_create", cmd);
});
@@ -1622,7 +1621,7 @@ command = "{}"
snapshot_merge_with_env(
"readme_example_hooks_pre_merge",
&repo,
- &["main", "--force"],
+ &["main", "--yes"],
Some(&feature_wt),
&[("PATH", &path_with_bin)],
);
diff --git a/tests/integration_tests/post_start_commands.rs b/tests/integration_tests/post_start_commands.rs
index bdc56544e..8d9b6c095 100644
--- a/tests/integration_tests/post_start_commands.rs
+++ b/tests/integration_tests/post_start_commands.rs
@@ -228,7 +228,7 @@ approved-commands = ["echo 'Default: {{ default_branch }}' > default.txt"]
snapshot_switch(
"post_create_default_branch_template",
&repo,
- &["--create", "feature", "--force"],
+ &["--create", "feature", "--yes"],
);
// Verify template expansion actually worked
@@ -271,7 +271,7 @@ worktree_name = "echo 'Worktree Name: {{ worktree_name }}' >> git_vars.txt"
snapshot_switch(
"post_create_git_variables_template",
&repo,
- &["--create", "feature", "--force"],
+ &["--create", "feature", "--yes"],
);
// Verify template expansion actually worked
@@ -337,7 +337,7 @@ fn test_post_create_upstream_template(#[from(repo_with_remote)] repo: TestRepo)
snapshot_switch(
"post_create_upstream_template",
&repo,
- &["--create", "feature", "--force"],
+ &["--create", "feature", "--yes"],
);
// Verify template expansion actually worked
diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rs
index 514fff42c..475919c61 100644
--- a/tests/integration_tests/shell_wrapper.rs
+++ b/tests/integration_tests/shell_wrapper.rs
@@ -864,7 +864,7 @@ mod tests {
"test-exec",
"--execute",
"echo executed",
- "--force",
+ "--yes",
],
);
@@ -905,7 +905,7 @@ mod tests {
"test-exit-code",
"--execute",
"exit 42",
- "--force",
+ "--yes",
],
);
@@ -1027,7 +1027,7 @@ approved-commands = [
// Run merge from the feature worktree
let output =
- exec_through_wrapper_from(shell, &repo, "merge", &["main", "--force"], &feature_wt);
+ exec_through_wrapper_from(shell, &repo, "merge", &["main", "--yes"], &feature_wt);
assert_eq!(output.exit_code, 0, "{}: Merge should succeed", shell);
output.assert_no_directive_leaks();
@@ -1087,7 +1087,7 @@ approved-commands = [
// Run merge from the feature worktree
let output =
- exec_through_wrapper_from(shell, &repo, "merge", &["main", "--force"], &feature_wt);
+ exec_through_wrapper_from(shell, &repo, "merge", &["main", "--yes"], &feature_wt);
output.assert_no_directive_leaks();
@@ -1161,7 +1161,7 @@ approved-commands = [
// Run merge from the feature worktree
let output =
- exec_through_wrapper_from(shell, &repo, "merge", &["main", "--force"], &feature_wt);
+ exec_through_wrapper_from(shell, &repo, "merge", &["main", "--yes"], &feature_wt);
assert_eq!(output.exit_code, 0, "{}: Merge should succeed", shell);
output.assert_no_directive_leaks();
@@ -1233,7 +1233,7 @@ approved-commands = ["echo 'test command executed'"]
"test-exec",
"--execute",
"echo executed",
- "--force",
+ "--yes",
],
);
@@ -1457,7 +1457,7 @@ approved-commands = ["echo 'fish background task'"]
"fish-multiline",
"--execute",
multiline_cmd,
- "--force",
+ "--yes",
],
);
@@ -2337,7 +2337,7 @@ command = "{}"
"bash",
&repo,
"merge",
- &["main", "--force"],
+ &["main", "--yes"],
&feature_wt,
&[],
&[("PATH", &path_with_bin)],
@@ -2428,7 +2428,7 @@ fi
"bash",
&repo,
"switch",
- &["--create", "feature-x", "--force"],
+ &["--create", "feature-x", "--yes"],
repo.root_path(),
&[],
&[("PATH", &path_with_bin)],
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__not_interactive.snap b/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__not_interactive.snap
index 623a5f6c2..45bba283c 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__not_interactive.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__git_error_display__not_interactive.snap
@@ -3,4 +3,4 @@ source: tests/integration_tests/git_error_display.rs
expression: err.to_string()
---
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rs
index b5c7f942e..e0b120d8f 100644
--- a/tests/integration_tests/switch.rs
+++ b/tests/integration_tests/switch.rs
@@ -372,7 +372,7 @@ fn test_switch_no_config_commands_with_force(repo: TestRepo) {
snapshot_switch(
"switch_no_hooks_with_force",
&repo,
- &["--create", "force-no-hooks", "--force", "--no-verify"],
+ &["--create", "force-no-hooks", "--yes", "--no-verify"],
);
}
// Branch inference and special branch tests
diff --git a/tests/integration_tests/user_hooks.rs b/tests/integration_tests/user_hooks.rs
index 735ea803f..1a5a49f4f 100644
--- a/tests/integration_tests/user_hooks.rs
+++ b/tests/integration_tests/user_hooks.rs
@@ -268,7 +268,7 @@ check = "echo 'USER_PRE_MERGE_RAN' > user_premerge.txt"
snapshot_merge(
"user_pre_merge_executes",
&repo,
- &["main", "--force", "--no-remove"],
+ &["main", "--yes", "--no-remove"],
Some(&feature_wt),
);
@@ -296,7 +296,7 @@ check = "exit 1"
snapshot_merge(
"user_pre_merge_failure",
&repo,
- &["main", "--force", "--no-remove"],
+ &["main", "--yes", "--no-remove"],
Some(&feature_wt),
);
}
@@ -319,7 +319,7 @@ check = "echo 'USER_PRE_MERGE' > user_premerge_marker.txt"
snapshot_merge(
"user_pre_merge_skipped_no_verify",
&repo,
- &["main", "--force", "--no-remove", "--no-verify"],
+ &["main", "--yes", "--no-remove", "--no-verify"],
Some(&feature_wt),
);
@@ -358,7 +358,7 @@ long = "sh -c 'echo start >> hook.log; sleep 30; echo done >> hook.log'"
// Spawn wt in its own process group (so SIGINT to that group doesn't kill the test)
let mut cmd = crate::common::wt_command();
cmd.current_dir(repo.root_path());
- cmd.args(["hook", "pre-merge", "--force"]);
+ cmd.args(["hook", "pre-merge", "--yes"]);
cmd.stdout(Stdio::null());
cmd.stderr(Stdio::null());
cmd.process_group(0); // wt becomes leader of its own process group
@@ -419,7 +419,7 @@ long = "sh -c 'echo start >> hook.log; sleep 30; echo done >> hook.log'"
// Spawn wt in its own process group (so SIGTERM to that group doesn't kill the test)
let mut cmd = crate::common::wt_command();
cmd.current_dir(repo.root_path());
- cmd.args(["hook", "pre-merge", "--force"]);
+ cmd.args(["hook", "pre-merge", "--yes"]);
cmd.stdout(Stdio::null());
cmd.stderr(Stdio::null());
cmd.process_group(0); // wt becomes leader of its own process group
@@ -479,7 +479,7 @@ notify = "echo 'USER_POST_MERGE_RAN' > user_postmerge.txt"
snapshot_merge(
"user_post_merge_executes",
&repo,
- &["main", "--force", "--no-remove"],
+ &["main", "--yes", "--no-remove"],
Some(&feature_wt),
);
@@ -624,7 +624,7 @@ lint = "echo 'USER_PRE_COMMIT_RAN' > user_precommit.txt"
snapshot_merge(
"user_pre_commit_executes",
&repo,
- &["main", "--force", "--no-remove"],
+ &["main", "--yes", "--no-remove"],
Some(&feature_wt),
);
@@ -654,7 +654,7 @@ lint = "exit 1"
snapshot_merge(
"user_pre_commit_failure",
&repo,
- &["main", "--force", "--no-remove"],
+ &["main", "--yes", "--no-remove"],
Some(&feature_wt),
);
}
@@ -755,7 +755,7 @@ fn test_standalone_hook_post_create(repo: TestRepo) {
let mut cmd = crate::common::wt_command();
cmd.current_dir(repo.root_path());
cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
- cmd.args(["hook", "post-create", "--force"]);
+ cmd.args(["hook", "post-create", "--yes"]);
let output = cmd.output().unwrap();
assert!(
@@ -779,7 +779,7 @@ fn test_standalone_hook_post_start(repo: TestRepo) {
let mut cmd = crate::common::wt_command();
cmd.current_dir(repo.root_path());
cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
- cmd.args(["hook", "post-start", "--force"]);
+ cmd.args(["hook", "post-start", "--yes"]);
let output = cmd.output().unwrap();
assert!(output.status.success(), "wt hook post-start should succeed");
@@ -800,7 +800,7 @@ fn test_standalone_hook_pre_commit(repo: TestRepo) {
let mut cmd = crate::common::wt_command();
cmd.current_dir(repo.root_path());
cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
- cmd.args(["hook", "pre-commit", "--force"]);
+ cmd.args(["hook", "pre-commit", "--yes"]);
let output = cmd.output().unwrap();
assert!(output.status.success(), "wt hook pre-commit should succeed");
@@ -819,7 +819,7 @@ fn test_standalone_hook_no_hooks_configured(repo: TestRepo) {
let mut cmd = crate::common::wt_command();
cmd.current_dir(repo.root_path());
cmd.env("WORKTRUNK_CONFIG_PATH", repo.test_config_path());
- cmd.args(["hook", "post-create", "--force"]);
+ cmd.args(["hook", "post-create", "--yes"]);
let output = cmd.output().unwrap();
assert!(
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap
index 95bee02a5..b05703395 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_fails_in_non_tty.snap
@@ -36,4 +36,4 @@ exit_code: 1
○ post-create:
  echo 'test command'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
index d31133c40..b73f7fd39 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
@@ -13,4 +13,4 @@ exit_code: 1
○ post-create third:
  echo 'Third command'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
index a1e9eb215..a180c18eb 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
@@ -17,4 +17,4 @@ exit_code: 1
○ post-create pwd:
  cd {{ worktree }} && pwd
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
index b631b0686..27e8b6e6e 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
@@ -15,4 +15,4 @@ exit_code: 1
○ post-create test:
  echo 'Running tests...'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap
index d3f73882c..44ddbc03f 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_single_command.snap
@@ -11,4 +11,4 @@ exit_code: 1
○ post-create:
  echo 'Worktree path: {{ worktree }}'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
index d31133c40..b73f7fd39 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
@@ -13,4 +13,4 @@ exit_code: 1
○ post-create third:
  echo 'Third command'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snap b/tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snap
index 436ef60ef..59ca718e5 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__force_bypasses_tty_check.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- test-force-tty
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snap
index d3696ae23..cf8fbb42c 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_first_run.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- test-force
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap
index 5103f5917..21f960ed8 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__force_does_not_save_approvals_second_run.snap
@@ -11,4 +11,4 @@ exit_code: 1
○ post-create:
  echo 'test command' > output.txt
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap
index f246d7583..28f5d6682 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_post_merge_requires_approval.snap
@@ -11,4 +11,4 @@ exit_code: 1
○ post-merge:
  echo 'Post-merge cleanup for {{ branch }}'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap
index c6f3f14de..0409cfa83 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__run_hook_pre_merge_requires_approval.snap
@@ -11,4 +11,4 @@ exit_code: 1
○ pre-merge:
  echo 'Running pre-merge checks on {{ branch }}'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__step_hook_name_filter_on_unnamed.snap b/tests/snapshots/integration__integration_tests__approval_ui__step_hook_name_filter_on_unnamed.snap
index a0f9e3747..8422bb11f 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__step_hook_name_filter_on_unnamed.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__step_hook_name_filter_on_unnamed.snap
@@ -6,7 +6,7 @@ info:
- hook
- pre-merge
- test
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__step_hook_unknown_name_error.snap b/tests/snapshots/integration__integration_tests__approval_ui__step_hook_unknown_name_error.snap
index c84d4cefd..118bea35f 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__step_hook_unknown_name_error.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__step_hook_unknown_name_error.snap
@@ -6,7 +6,7 @@ info:
- hook
- pre-merge
- nonexistent
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_already_approved.snap b/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_already_approved.snap
index b1edd57fd..8bc6e4af5 100644
--- a/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_already_approved.snap
+++ b/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_already_approved.snap
@@ -36,4 +36,4 @@ exit_code: 1
○ post-create:
  echo 'test'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap b/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap
index a4bc0bc4c..a64ba4edf 100644
--- a/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap
+++ b/tests/snapshots/integration__integration_tests__approvals__add_approvals_all_none_approved.snap
@@ -37,4 +37,4 @@ exit_code: 1
○ post-create:
  echo 'test'
✗ Cannot prompt for approval in non-interactive environment
-↳ To skip prompts in CI/CD, add --force; to pre-approve commands, run wt hook approvals add
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_all_already_configured.snap b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_all_already_configured.snap
index 3a3ed2a88..3d677e780 100644
--- a/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_all_already_configured.snap
+++ b/tests/snapshots/integration__integration_tests__configure_shell__configure_shell_fish_all_already_configured.snap
@@ -7,7 +7,7 @@ info:
- shell
- install
- fish
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
index 2297cf44c..2822090ac 100644
--- a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
@@ -9,7 +9,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_CONFIG_GLOBAL: ""
+ GIT_EDITOR: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -56,7 +56,7 @@ This prevents untrusted projects from running arbitrary commands.
- Project ID changes (repository moves)
Bypassing prompts:
-- --force flag on individual commands (e.g., wt merge --force)
+- --yes flag on individual commands (e.g., wt merge --yes)
- Useful for CI/automation where prompts aren't possible
Examples
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index f2b4eef06..f9de4a6b0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -44,7 +44,7 @@ Options:
--no-verify
Skip hooks
- -f, --force
+ -y, --yes
Skip approval prompts
--stage <STAGE>
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index e92c794df..40affc34c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -46,7 +46,7 @@ Usage: wt merge [OPTIONS] [TARGET]
--no-verify
Skip hooks
- -f, --force
+ -y, --yes
Skip approval prompts
--stage <STAGE>
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
index fa0e4d19b..eae77d2d2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
@@ -9,6 +9,7 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
@@ -30,7 +31,7 @@ Usage: wt merge [OPTIONS] [TARGET]
--no-rebase Skip rebase (fail if not already rebased)
--no-remove Keep worktree after merge
--no-verify Skip hooks
- -f, --force Skip approval prompts
+ -y, --yes Skip approval prompts
--stage <STAGE> What to stage before committing [default: all] [possible values: all, tracked, none]
-h, --help Print help (see more with '--help')
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap b/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
index b2a482dcb..f4b19983c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_page_merge.snap
@@ -125,7 +125,7 @@ Usage: wt merge [OPTIONS] [TARGET]
--no-verify
Skip hooks
- -f, --force
+ -y, --yes
Skip approval prompts
--stage <STAGE>
diff --git a/tests/snapshots/integration__integration_tests__help__help_page_switch.snap b/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
index 290a1e7a8..8205d2bbe 100644
--- a/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_page_switch.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_CONFIG_GLOBAL: ""
+ GIT_EDITOR: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -116,7 +116,7 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
Arguments after -- are passed to the command, so wsc feature --
'implement login' works.
- -f, --force
+ -y, --yes
Skip approval prompts
--clobber
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index dea7f34be..cc85cce84 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -39,10 +39,13 @@ Usage: wt remove [OPTIONS] [WORKTREES]...
--no-verify
Skip hooks
+ -y, --yes
+ Skip approval prompts
+
-f, --force
- Force removal
+ Force worktree removal
- Skip approval prompts, and remove worktrees even if they contain untracked files (like build artifacts).
+ Remove worktrees even if they contain untracked files (like build artifacts). Without this flag, removal fails if untracked files exist.
-h, --help
Print help (see a summary with '-h')
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index 6505719db..eaf1df207 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -30,7 +30,8 @@ Usage: wt remove [OPTIONS] [WORKTREES]...
-D, --force-delete Delete unmerged branches
--no-background Run removal in foreground
--no-verify Skip hooks
- -f, --force Force removal
+ -y, --yes Skip approval prompts
+ -f, --force Force worktree removal
-h, --help Print help (see more with '--help')
Global Options:
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 673e2b98d..7472cade3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -8,7 +8,7 @@ info:
env:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
- GIT_CONFIG_GLOBAL: ""
+ GIT_EDITOR: ""
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
@@ -56,7 +56,7 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
Then wsc feature-branch creates the worktree and launches Claude Code. Arguments after -- are passed to the command, so wsc feature --
'implement login' works.
- -f, --force
+ -y, --yes
Skip approval prompts
--clobber
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
index 4d0d6e0ef..b69cdfae2 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -30,7 +30,7 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
-c, --create Create a new branch
-b, --base <BASE> Base branch
-x, --execute <EXECUTE> Command to run after switch
- -f, --force Skip approval prompts
+ -y, --yes Skip approval prompts
--clobber Remove stale paths at target
--no-verify Skip hooks
-h, --help Print help (see more with '--help')
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
index 22612799b..22daabac3 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
index 1ade67171..a4c8cd761 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_no_verify.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_no_verify.snap
index d840294d9..58fb7d3b9 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_no_verify.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_no_verify.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-verify"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
index 843b6aaca..f02f76ab6 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap
index 7c87dc087..c8fbf0764 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap
@@ -4,7 +4,7 @@ info:
program: wt
args:
- merge
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap
index f7976d738..3f29b2b0a 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
index c76af18fa..ec5308fb5 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
index 60ddb6627..ac3f423d0 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
index e5515d54c..02fd69237 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
index 49204c240..94725fc99 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
index d9c20bfa9..c51fbf860 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
index 1f577a8e7..ffad989cb 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
index 9a5de3fa1..e7e5c2946 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
index b87e27528..bd6802252 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap
index 2f93338be..5a106dcb0 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- feature-x
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap
index 03c979895..3315b339e 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap
index 30c7a63e9..3f6beee29 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- feature
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap
index 3efc3110c..7a5569378 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- feature
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap
index de3de8cd6..ca1ad36a4 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- feature
- - "--force"
+ - "--yes"
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap
index 193a500a6..f55e42321 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_force.snap
@@ -6,7 +6,7 @@ info:
- switch
- "--create"
- force-no-hooks
- - "--force"
+ - "--yes"
- "--no-verify"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap
index 767b7410f..4050cd45a 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-remove"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap
index e41e8d7c4..15138dc71 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-remove"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap
index 7ddca0c8b..c45a2db0c 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-remove"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap
index 19589ab33..2ea9de72b 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-remove"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap
index a2b958452..078d2c992 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-remove"
env:
APPDATA: "[TEST_CONFIG_HOME]"
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_skipped_no_verify.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_skipped_no_verify.snap
index edc6ec342..d01e16941 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_skipped_no_verify.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_skipped_no_verify.snap
@@ -5,7 +5,7 @@ info:
args:
- merge
- main
- - "--force"
+ - "--yes"
- "--no-remove"
- "--no-verify"
env: