generate

package
Version: v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CMD = &cobra.Command{
	Use:   "generate",
	Short: "extracts completion file from kubectl.",
	Run: func(cmd *cobra.Command, args []string) {
		wd, err := os.Getwd()
		if err != nil {
			fmt.Println(errors.WithMessage(errors.WithStack(err), "failed to get wd"))
			os.Exit(1)
		}

		settings := settings{
			completionFile,
			filepath.Join(wd, outFilename),
		}
		exe.Execute(`cp {{.From}} {{.To}}`, settings)

		handleError(os.Chmod(settings.To, 0755))

		removeUnwantedDeclarations(settings)

		exe.Execute(`goimports -w {{.To}}`, settings)
	},
}

Functions

This section is empty.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL