From 9514b2396cbbdae8aa3c6bc8d396f8a00b8ad213 Mon Sep 17 00:00:00 2001 From: JoshuaBrewer Date: Wed, 10 Jan 2024 14:46:13 -0600 Subject: [PATCH] fix: inclusion of helm sub commands in zarf tools help (#2216) ## Description Fixing zarf tools return output to include helm when running both zarf tools and zarf tools -h ## Related Issue Fixes #2143 ## Type of change - [ X] Bug fix (non-breaking change which fixes an issue) Co-authored-by: Wayne Starr --- src/cmd/tools/helm.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd/tools/helm.go b/src/cmd/tools/helm.go index 2a3b301595..14c150acf5 100644 --- a/src/cmd/tools/helm.go +++ b/src/cmd/tools/helm.go @@ -15,13 +15,13 @@ import ( func init() { actionConfig := new(action.Configuration) - // Since helm needs args passed into it, check if we are processing things on a command with fewer args - if len(os.Args) < 3 { - return + // Truncate Helm's arguments so that it thinks its all alone + helmArgs := []string{} + if len(os.Args) > 2 { + helmArgs = os.Args[3:] } - // The inclusion of Helm in this manner should be reconsidered once https://github.com/helm/helm/issues/12122 is resolved - helmCmd, _ := helm.NewRootCmd(actionConfig, os.Stdout, os.Args[3:]) + helmCmd, _ := helm.NewRootCmd(actionConfig, os.Stdout, helmArgs) helmCmd.Short = lang.CmdToolsHelmShort helmCmd.Long = lang.CmdToolsHelmLong