Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,10 @@ func handleEndpointExtensions(cmdArgs []string, pluginBinDir string) error {

// Giving plugin information about how it was invoked, so it can give correct help
pluginCommandName := os.Args[0] + " " + strings.Join(remainingArgs, " ")
environ := append(os.Environ(),
fmt.Sprintf("BINARY_NAME=%s", pluginCommandName),
fmt.Sprintf("TOP_LEVEL_COMMAND=%s", pluginCommandName))
os.Setenv("BINARY_NAME", pluginCommandName)
os.Setenv("TOP_LEVEL_COMMAND", pluginCommandName)
// invoke cmd binary relaying the current environment and args given
// remainingArgs will always have at least one element.
// execute will make remainingArgs[0] the "binary name".
return plugins.Execute(foundBinaryPath, nextArgs, environ)
return plugins.Execute(foundBinaryPath, nextArgs, os.Environ())
}