From 94ed96dfa9cc2d6dc667556a7fd5a672b503b845 Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 25 Aug 2026 18:27:44 +0200 Subject: always output exit error messages --- main.go | 1 + modes.go | 1 + spool/exit.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 084945f..38a955b 100644 --- a/main.go +++ b/main.go @@ -89,6 +89,7 @@ func mode[T any](list ModeMap[T], fire func(mode T) *spool.ExitCode) *spool.Exit return fire(in) }) if code != nil { + _, _ = spool.Warn("%v\n", code.Message) code.Exit() } return nil diff --git a/modes.go b/modes.go index deb1509..ae6c27c 100644 --- a/modes.go +++ b/modes.go @@ -60,6 +60,7 @@ var uninitializedModes = ModeMap[func() *spool.ExitCode]{ // like --version and --completion var statelessModes = ModeMap[func() *spool.ExitCode]{ flags.InstallCompletion: func() *spool.ExitCode { + _ = paths.Component.Init() sh := os.Getenv("SHELL") if sh == "" { return spool.UnknownShellFailure diff --git a/spool/exit.go b/spool/exit.go index 77bff44..e5c6088 100644 --- a/spool/exit.go +++ b/spool/exit.go @@ -25,8 +25,8 @@ var ( NoTargetsFailure = MenuFailure.Next("no targets found") NoEditorFailure = NoTargetsFailure.Next("$EDITOR not set") NoDebugInfo = NoEditorFailure.Next("could not read debug info") - ManFailure = New(120, "failure to generate manual pages") UnknownShellFailure = New(110, "unable to detect shell type through $SHELL") + ManFailure = New(120, "failure to generate manual pages") CompletionAlreadyInstalledFailure = UnknownShellFailure.Next("completion seems already installed") CompletionFailure = CompletionAlreadyInstalledFailure.Next("failed to install completion") ProfilingFailure = CompletionFailure.Next("failed to initialize profiler") -- cgit v1.3.1