INNER CODE UNIT · Go
Execute
itaysk/kubectl-neat · cmd/cmd.go:44
func Execute() {
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
}
}
var rootCmd = &cobra.Command{
Use: "kubectl-neat",
Example: `kubectl get pod mypod -o yaml | kubectl neat
kubectl get pod mypod -oyaml | kubectl neat -o json
kubectl neat -f - <./my-pod.json
kubectl neat -f ./my-pod.json
kubectl neat -f ./my-pod.json --output yaml`,
RunE: func(cmd *cobra.Command, args []string) error {
var in, out []byte
var err error
if *inputFile == "-" {
stdin := cmd.InOrStdin()