mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 16:42:51 +00:00
move files into internal
This commit is contained in:
30
cmd/pluginator/internal/krmfunction/cmd.go
Normal file
30
cmd/pluginator/internal/krmfunction/cmd.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package krmfunction
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// NewKrmFunctionCmd returns a pointer to a command
|
||||
func NewKrmFunctionCmd() *cobra.Command {
|
||||
var outputDir string
|
||||
var inputFile string
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "krm -i FILE -o DIR",
|
||||
Short: "Convert the plugin to KRM function instead of builtin function",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
c := NewConverter(outputDir, inputFile)
|
||||
return c.Convert()
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().StringVarP(&outputDir, "output", "o", "",
|
||||
"Path to the directory which will contain the KRM function")
|
||||
cmd.Flags().StringVarP(&inputFile, "input", "i", "",
|
||||
"Path to the input file")
|
||||
|
||||
cmd.MarkFlagRequired("output")
|
||||
cmd.MarkFlagRequired("input")
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user