kyaml: refactor command documentation into .md files from go files

No new documentation added.
This commit is contained in:
Phillip Wittrock
2019-11-22 11:59:08 -08:00
parent 2a5f513bc3
commit 3345464b25
29 changed files with 885 additions and 411 deletions

View File

@@ -1,6 +1,8 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
//go:generate $GOBIN/mdtogo docs/api-conventions cmddocs/api --full=true
//go:generate $GOBIN/mdtogo docs/commands cmddocs/commands
package main
import (
@@ -8,33 +10,39 @@ import (
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/cmd/config/cmd"
"sigs.k8s.io/kustomize/kyaml/yaml/merge2"
"sigs.k8s.io/kustomize/kyaml/yaml/merge3"
"sigs.k8s.io/kustomize/cmd/config/cmddocs/api"
)
var root = &cobra.Command{
Use: "kyaml",
Short: "kyaml reference comand",
Long: `Description:
Reference implementation for using the kyaml libraries.
`,
Example: ``,
Use: "config",
Short: "Utilities for working with Resource Configuration.",
Long: `Utilities for working with Resource Configuration.`,
}
func main() {
root.PersistentFlags().BoolVar(&cmd.StackOnError, "stack-trace", false,
"print a stack-trace on failure")
name := "config"
cmd.ExitOnError = true
root.AddCommand(cmd.GrepCommand())
root.AddCommand(cmd.TreeCommand())
root.AddCommand(cmd.CatCommand())
root.AddCommand(cmd.FmtCommand())
root.AddCommand(cmd.MergeCommand())
root.AddCommand(cmd.CountCommand())
root.AddCommand(cmd.RunFnCommand())
root.AddCommand(&cobra.Command{Use: "merge", Long: merge2.Help})
root.AddCommand(&cobra.Command{Use: "merge3", Long: merge3.Help})
root.AddCommand(cmd.GrepCommand(name))
root.AddCommand(cmd.TreeCommand(name))
root.AddCommand(cmd.CatCommand(name))
root.AddCommand(cmd.FmtCommand(name))
root.AddCommand(cmd.MergeCommand(name))
root.AddCommand(cmd.CountCommand(name))
root.AddCommand(cmd.RunFnCommand(name))
root.AddCommand(&cobra.Command{
Use: "docs-merge",
Short: "Documentation for merging Resources (2-way merge).",
Long: api.Merge2Long,
})
root.AddCommand(&cobra.Command{
Use: "docs-merge3",
Short: "Documentation for merging Resources (3-way merge).",
Long: api.Merge3Long,
})
if err := root.Execute(); err != nil {
os.Exit(1)