func NewCmdKptUpdate() (*cobra.Command, *Options) {
	o := &Options{}
	cmd := &cobra.Command{
		Use:     "update",
		Short:   "Updates any kpt packages installed in a sub directory",
		Long:    kptLong,
		Example: fmt.Sprintf(kptExample, rootcmd.BinaryName),
		Run: func(cmd *cobra.Command, args []string) {
			err := o.Run()
			helper.CheckErr(err)
		},
	}
	o.AddFlags(cmd)
	return cmd, o
}
NewCmdKptUpdate creates a command object for the command
package update
import (
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"github.com/jenkins-x/jx-helpers/v3/pkg/gitclient"
	"github.com/jenkins-x/jx-helpers/v3/pkg/gitclient/cli"
	"github.com/jenkins-x/jx-helpers/v3/pkg/options"
	"sigs.k8s.io/yaml"
	kyaml "sigs.k8s.io/kustomize/kyaml/yaml"
	"github.com/jenkins-x-plugins/jx-gitops/pkg/apis/gitops/v1alpha1"
	"github.com/jenkins-x/jx-helpers/v3/pkg/termcolor"
	"github.com/jenkins-x/jx-helpers/v3/pkg/files"
	"github.com/jenkins-x-plugins/jx-gitops/pkg/plugins"
	"github.com/jenkins-x-plugins/jx-gitops/pkg/rootcmd"
	"github.com/jenkins-x/jx-helpers/v3/pkg/cmdrunner"
	"github.com/jenkins-x/jx-helpers/v3/pkg/cobras/helper"
	"github.com/jenkins-x/jx-helpers/v3/pkg/cobras/templates"
	"github.com/jenkins-x/jx-helpers/v3/pkg/gitclient/giturl"
	"github.com/jenkins-x/jx-helpers/v3/pkg/maps"
	"github.com/jenkins-x/jx-logging/v3/pkg/log"
	"github.com/pkg/errors"
	"github.com/spf13/cobra"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
var (
	kptLong = templates.LongDesc(`
		Updates any kpt packages installed in a sub directory
		If you know a specific directory which needs updating you can always use 'kpt' directly via:
  		    kpt pkg update mySubDir
`)
	kptExample = templates.Examples(`
		# recurses the current dir looking for directories with Kptfile inside 
		# and upgrades the kpt package found there to the latest version
		%s kpt --dir .
	`)
	pathSeparator = string(os.PathSeparator)
	info = termcolor.ColorInfo
)
type Options struct {
	options.BaseOptions
	Dir                    string
	Version                string
	RepositoryURL          string
	RepositoryOwner        string
	RepositoryName         string
	KptBinary              string
	Strategy               string
	IgnoreYamlContentError bool
	GitClient              gitclient.Interface
	CommandRunner          cmdrunner.CommandRunner
}