func GetMain()

in mpdev/cmd/rootcmd.go [28:46]


func GetMain() *cobra.Command {
	cmd := &cobra.Command{
		Use:     "mpdev",
		Short:   docs.ReferenceShort,
		Long:    docs.ReferenceLong,
		Example: docs.ReferenceExamples,
		PersistentPreRun: func(cmd *cobra.Command, args []string) {
			// Override openApi file location such that KptFile will be modified
			// by mpdev cfg commands.
			// See: https://github.com/GoogleContainerTools/kpt/blob/bf211c225274fe6747304c9b6bf55ea5a98b603a/run/run.go#L48
			ext.GetOpenAPIFile = func(args []string) (s string, err error) {
				return filepath.Join(args[0], kptFileName), nil
			}
		},
	}
	cmd.AddCommand(GetMpdevCommands("mpdev")...)

	return cmd
}