File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 8383 globalHostBalance string
8484 globalTLSCert atomic.Pointer [[]byte ]
8585 globalKeyPassword string
86+ globalExitCode int
8687)
8788
8889const (
@@ -1075,6 +1076,7 @@ func sidekickMain(ctx *cli.Context) {
10751076 globalHostBalance = "least"
10761077 }
10771078 globalKeyPassword = ctx .GlobalString ("key-password" )
1079+ globalExitCode = ctx .GlobalInt ("exit-code" )
10781080
10791081 tlsMaxVersion := uint16 (tls .VersionTLS13 )
10801082 switch tlsMax := ctx .GlobalString ("tls-max" ); tlsMax {
@@ -1242,7 +1244,7 @@ func sidekickMain(ctx *cli.Context) {
12421244 })
12431245 default :
12441246 console .Infof ("caught signal '%s'\n " , signal )
1245- os .Exit (1 )
1247+ os .Exit (globalExitCode )
12461248 }
12471249 }
12481250}
@@ -1381,6 +1383,11 @@ func main() {
13811383 Value : "1.3" ,
13821384 Hidden : true ,
13831385 },
1386+ cli.IntFlag {
1387+ Name : "exit-code" ,
1388+ Usage : "exit code to use when program terminates by a signal" ,
1389+ Value : 1 ,
1390+ },
13841391 }
13851392 app .CustomAppHelpTemplate = `NAME:
13861393 {{.Name}} - {{.Description}}
You can’t perform that action at this time.
0 commit comments