Skip to content

Commit

Permalink
fix: inclusion of helm sub commands in zarf tools help (#2216)
Browse files Browse the repository at this point in the history
## 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 <Racer159@users.noreply.github.com>
  • Loading branch information
jbrewer3 and Racer159 committed Jan 10, 2024
1 parent 59fbd83 commit 9514b23
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cmd/tools/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9514b23

Please sign in to comment.