From 5c58f7bf02819dca794dcad738fda41726bd5096 Mon Sep 17 00:00:00 2001 From: Dean Eigenmann <7621705+decanus@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:37:19 +0200 Subject: [PATCH] Update command.go --- command.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/command.go b/command.go index d2d74e13..6a192292 100644 --- a/command.go +++ b/command.go @@ -141,7 +141,7 @@ type Command struct { // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error // OnKillRun: run if a commands execution is exited - OnKillRun func(cmd *Command, args []string) + OnKillRun func(cmd *Command, args []string, os.Signal) // groups for subcommands commandgroups []*Group @@ -939,15 +939,14 @@ func (c *Command) execute(a []string) (err error) { signal.Notify( sigchan, syscall.SIGINT, - syscall.SIGKILL, syscall.SIGTERM, syscall.SIGQUIT, ) go func() { - _ = <-sigchan + s := <-sigchan - c.OnKillRun(c, argWoFlags) + c.OnKillRun(c, argWoFlags, s) }() }