From ef8170be1e8699378f5f3e87462e7df0a54d2cf3 Mon Sep 17 00:00:00 2001 From: Ernst von Oelsen Date: Thu, 30 Jan 2025 19:37:02 +0100 Subject: [PATCH] Print os.Args prior to exiting. Signed-off-by: Ernst von Oelsen --- pkg/app/execontext.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/app/execontext.go b/pkg/app/execontext.go index 74ab84fb..28f22949 100644 --- a/pkg/app/execontext.go +++ b/pkg/app/execontext.go @@ -23,6 +23,7 @@ const ( type ExecutionContext struct { Out *Output + Args []string cleanupHandlers []func() } @@ -98,7 +99,9 @@ func (ref *ExecutionContext) exit(exitCode int) { ref.Out.Info("exit", OutVars{ "code": exitCode, "version": v.Current(), - "location": fsutil.ExeDir()}) + "location": fsutil.ExeDir(), + "args": os.Args}) + } ShowCommunityInfo(ref.Out.OutputFormat) @@ -116,7 +119,8 @@ func NewExecutionContext( } ref := &ExecutionContext{ - Out: NewOutput(cmdName, quiet, outputFormat, chs), + Out: NewOutput(cmdName, quiet, outputFormat, chs), + Args: os.Args, } return ref