Try adding header to generated CLI docs

Fix #2834
This commit is contained in:
Justin Santa Barbara 2017-07-15 12:03:55 -04:00
parent b604917142
commit 17b3fa36eb
41 changed files with 130 additions and 1 deletions

View File

@ -21,6 +21,11 @@ import (
"github.com/spf13/cobra/doc"
)
const fileHeader = `
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
`
type GenHelpDocsCmd struct {
cobraCommand *cobra.Command
OutDir string
@ -55,5 +60,9 @@ func (c *GenHelpDocsCmd) Run() error {
for _, c := range rootCommand.cobraCommand.Commands() {
c.Flag("state").DefValue = ""
}
return doc.GenMarkdownTree(rootCommand.cobraCommand, c.OutDir)
linkHandler := func(link string) string { return link }
filePrepender := func(filname string) string { return fileHeader }
return doc.GenMarkdownTreeCustom(rootCommand.cobraCommand, c.OutDir, filePrepender, linkHandler)
}

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops
kops is Kubernetes ops.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops completion
Output shell completion code for the given shell (bash or zsh).

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops create
Create a resource by command line, filename or stdin.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops create cluster
Create a Kubernetes cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops create instancegroup
Create an instancegroup.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops create secret
Create a secret.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops create secret sshpublickey
Create a ssh public key.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops delete
Delete clusters,instancegroups, or secrets.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops delete cluster
Delete a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops delete instancegroup
Delete instancegroup

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops delete secret
Delete a secret

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops describe
Describe a resource.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops describe secrets
Describe a cluster secret

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops edit
Edit clusters and other resources.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops edit cluster
Edit cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops edit federation
Edit federation.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops edit instancegroup
Edit instancegroup.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops export
Export configuration.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops export kubecfg
Export kubecfg.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops get
Get one or many resources.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops get clusters
Get one or many clusters.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops get federations
Get federation.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops get instancegroups
Get one or many instancegroups

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops get secrets
Get one or many secrets.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops import
Import a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops import cluster
Import a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops replace
Replace cluster resources.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops rolling-update
Rolling update a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops rolling-update cluster
Rolling update a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops toolbox
Misc infrequently used commands.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops toolbox convert-imported
Convert an imported cluster into a kops cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops toolbox dump
Dump cluster information

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops update
Update a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops update cluster
Update a cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops update federation
Update federation cluster resources.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops upgrade
Upgrade a kubernetes cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops upgrade cluster
Upgrade a kubernetes cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops validate
Validate a kops cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops validate cluster
Validate a kops cluster.

View File

@ -1,3 +1,6 @@
<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code (under cmd/kops) -->
## kops version
Print the kops version information.