diff options
| author | ewy <ewy0@protonmail.com> | 2026-08-25 18:27:44 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-08-25 18:27:44 +0200 |
| commit | 94ed96dfa9cc2d6dc667556a7fd5a672b503b845 (patch) | |
| tree | 022a705f926cbc1be3cca75742b4d4494a54989e | |
| parent | 0621dd7ceba85931ce37f95026231a26879e814b (diff) | |
always output exit error messages
| -rw-r--r-- | main.go | 1 | ||||
| -rw-r--r-- | modes.go | 1 | ||||
| -rw-r--r-- | spool/exit.go | 2 |
3 files changed, 3 insertions, 1 deletions
@@ -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 @@ -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") |
