Skip to content

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

refactor(output): drop unused Result on shell-install print helpers (#2670)

Worktrunk Bot3b1b752f9abb
diff --git a/src/main.rs b/src/main.rs
index 702696fe5..bd2d00067 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -533,7 +533,7 @@ fn handle_config_shell_command(action: ConfigShellCommand, yes: bool) -> anyhow:
// Exit with error if no shells configured
// Show skipped shells first so user knows what was tried
if scan_result.configured.is_empty() {
- crate::output::print_skipped_shells(&scan_result.skipped)?;
+ crate::output::print_skipped_shells(&scan_result.skipped);
return Err(worktrunk::git::GitError::Other {
message: "No shell config files found".into(),
}
@@ -543,7 +543,8 @@ fn handle_config_shell_command(action: ConfigShellCommand, yes: bool) -> anyhow:
if dry_run {
return Ok(());
}
- crate::output::print_shell_install_result(&scan_result)
+ crate::output::print_shell_install_result(&scan_result);
+ Ok(())
})
}
ConfigShellCommand::Uninstall { shell, dry_run } => {
diff --git a/src/output/shell_integration.rs b/src/output/shell_integration.rs
index f8cf32b69..81b47c2f4 100644
--- a/src/output/shell_integration.rs
+++ b/src/output/shell_integration.rs
@@ -212,9 +212,7 @@ fn compute_shell_warning_reason_inner(
}
/// Print skipped shells (config file not found).
-pub fn print_skipped_shells(
- skipped: &[(worktrunk::shell::Shell, std::path::PathBuf)],
-) -> anyhow::Result<()> {
+pub fn print_skipped_shells(skipped: &[(worktrunk::shell::Shell, std::path::PathBuf)]) {
for (shell, path) in skipped {
let path = format_path_for_display(path);
eprintln!(
@@ -224,7 +222,6 @@ pub fn print_skipped_shells(
))
);
}
- Ok(())
}
fn shell_extension_label(shell: Shell) -> &'static str {
@@ -261,9 +258,7 @@ fn print_config_action_result(action: &ConfigAction, message: String) {
/// - Restart hint for current shell
///
/// Used by both `wt config shell install` and the interactive prompt after `wt switch`.
-pub fn print_shell_install_result(
- scan_result: &crate::commands::configure_shell::ScanResult,
-) -> anyhow::Result<()> {
+pub fn print_shell_install_result(scan_result: &crate::commands::configure_shell::ScanResult) {
// Count shells that became (more) configured
let shells_configured_count = scan_result
.configured
@@ -329,7 +324,7 @@ pub fn print_shell_install_result(
}
// Show skipped shells
- print_skipped_shells(&scan_result.skipped)?;
+ print_skipped_shells(&scan_result.skipped);
// Summary
if shells_configured_count > 0 {
@@ -379,8 +374,6 @@ pub fn print_shell_install_result(
eprintln!("{}", hint_message(shell_restart_hint()));
}
}
-
- Ok(())
}
/// Handle shell integration prompt/hint after switch when shell integration is not active.
@@ -480,7 +473,7 @@ pub fn prompt_shell_integration(
let install_result = handle_configure_shell(None, true, false, binary_name.to_string())
.map_err(|e| anyhow::anyhow!("Failed to configure shell integration: {e}"))?;
- print_shell_install_result(&install_result)?;
+ print_shell_install_result(&install_result);
Ok(true)
}