Skip to content

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

Remove --force flag from approvals add command

Maximilian Roosa57e7dd4576e
diff --git a/src/cli.rs b/src/cli.rs
index 55d5809f7..d453c5d7c 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -254,13 +254,9 @@ pub enum ApprovalsCommand {
after_long_help = r#"Prompts for approval of all project commands and saves them to user config.
By default, shows only unapproved commands. Use `--all` to review all commands
-including previously approved ones. Use `--force` to approve without prompts."#
+including previously approved ones."#
)]
Add {
- /// Skip approval prompts
- #[arg(short, long)]
- force: bool,
-
/// Show all commands
#[arg(long)]
all: bool,
diff --git a/src/commands/standalone.rs b/src/commands/standalone.rs
index bcb10d851..59a813377 100644
--- a/src/commands/standalone.rs
+++ b/src/commands/standalone.rs
@@ -560,7 +560,7 @@ pub fn handle_rebase(target: Option<&str>) -> anyhow::Result<RebaseResult> {
}
/// Handle `wt config approvals add` command - approve all commands in the project
-pub fn add_approvals(force: bool, show_all: bool) -> anyhow::Result<()> {
+pub fn add_approvals(show_all: bool) -> anyhow::Result<()> {
use super::command_approval::approve_command_batch;
use worktrunk::config::WorktrunkConfig;
@@ -603,21 +603,15 @@ pub fn add_approvals(force: bool, show_all: bool) -> anyhow::Result<()> {
commands
};
- // Call the approval prompt
+ // Call the approval prompt (force=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
- let approved = approve_command_batch(&commands_to_approve, &project_id, &config, force, true)?;
+ let approved = approve_command_batch(&commands_to_approve, &project_id, &config, false, true)?;
// Show result
if approved {
- if force {
- // When using --force, commands aren't saved to config
- crate::output::print(success_message("Commands approved; not saved (--force)"))?;
- } else {
- // Interactive approval - commands were saved to config (unless save failed)
- crate::output::print(success_message("Commands approved & saved to config"))?;
- }
+ crate::output::print(success_message("Commands approved & saved to config"))?;
} else {
crate::output::print(info_message("Commands declined"))?;
}
diff --git a/src/main.rs b/src/main.rs
index 98ceb697c..26035ac57 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -892,7 +892,7 @@ fn main() {
VarCommand::Clear { key, branch, all } => handle_var_clear(&key, branch, all),
},
ConfigCommand::Approvals { action } => match action {
- ApprovalsCommand::Add { force, all } => add_approvals(force, all),
+ ApprovalsCommand::Add { all } => add_approvals(all),
ApprovalsCommand::Clear { global } => clear_approvals(global),
},
},
diff --git a/tests/integration_tests/approvals.rs b/tests/integration_tests/approvals.rs
index 9dae5ac10..27b710f25 100644
--- a/tests/integration_tests/approvals.rs
+++ b/tests/integration_tests/approvals.rs
@@ -36,16 +36,6 @@ fn test_add_approvals_no_config() {
snapshot_add_approvals("add_approvals_no_config", &repo, &[]);
}
-#[test]
-fn test_add_approvals_force() {
- let repo = TestRepo::new();
- repo.commit("Initial commit");
- repo.write_project_config(r#"post-create = "echo 'test'""#);
- repo.commit("Add config");
-
- snapshot_add_approvals("add_approvals_force", &repo, &["--force"]);
-}
-
#[test]
fn test_add_approvals_all_with_none_approved() {
let repo = TestRepo::new();
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap b/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
index 8bc54a140..a19f2b76c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_approvals_add.snap
@@ -24,9 +24,6 @@ wt config approvals add - Store approvals in config
Usage: wt config approvals add [OPTIONS]
Options:
- -f, --force
- Skip approval prompts
-
--all
Show all commands
@@ -46,4 +43,4 @@ Usage: wt config approvals add [OPTIONS]
Prompts for approval of all project commands and saves them to user config.
By default, shows only unapproved commands. Use --all to review all commands
-including previously approved ones. Use --force to approve without prompts.
+including previously approved ones.