get.porter.sh/porter@v1.3.0/cmd/exec/uninstall.go (about)

     1  package main
     2  
     3  import (
     4  	"get.porter.sh/porter/pkg/exec"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  func buildUninstallCommand(m *exec.Mixin) *cobra.Command {
     9  	opts := exec.ExecuteOptions{}
    10  
    11  	cmd := &cobra.Command{
    12  		Use:   "uninstall",
    13  		Short: "Execute the uninstall functionality of this mixin",
    14  		RunE: func(cmd *cobra.Command, args []string) error {
    15  			return m.Execute(cmd.Context(), opts)
    16  		},
    17  	}
    18  	flags := cmd.Flags()
    19  	flags.StringVarP(&opts.File, "file", "f", "", "Path to the script to execute")
    20  	return cmd
    21  }