Skip to content

Commit

Permalink
Try adding header to generated CLI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Jul 15, 2017
1 parent d2e5ec2 commit d797eb1
Show file tree
Hide file tree
Showing 41 changed files with 90 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/kops/gen_help_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
`

type GenHelpDocsCmd struct {
cobraCommand *cobra.Command
OutDir string
Expand Down Expand Up @@ -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)
}
2 changes: 2 additions & 0 deletions docs/cli/kops.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops

kops is Kubernetes ops.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_completion.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops completion

Output shell completion code for the given shell (bash or zsh).
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_create.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops create

Create a resource by command line, filename or stdin.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_create_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops create cluster

Create a Kubernetes cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_create_instancegroup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops create instancegroup

Create an instancegroup.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_create_secret.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops create secret

Create a secret.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_create_secret_sshpublickey.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops create secret sshpublickey

Create a ssh public key.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_delete.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops delete

Delete clusters,instancegroups, or secrets.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_delete_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops delete cluster

Delete a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_delete_instancegroup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops delete instancegroup

Delete instancegroup
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_delete_secret.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops delete secret

Delete a secret
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_describe.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops describe

Describe a resource.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_describe_secrets.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops describe secrets

Describe a cluster secret
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_edit.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops edit

Edit clusters and other resources.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_edit_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops edit cluster

Edit cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_edit_federation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops edit federation

Edit federation.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_edit_instancegroup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops edit instancegroup

Edit instancegroup.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_export.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops export

Export configuration.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_export_kubecfg.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops export kubecfg

Export kubecfg.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_get.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops get

Get one or many resources.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_get_clusters.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops get clusters

Get one or many clusters.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_get_federations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops get federations

Get federation.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_get_instancegroups.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops get instancegroups

Get one or many instancegroups
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_get_secrets.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops get secrets

Get one or many secrets.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_import.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops import

Import a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_import_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops import cluster

Import a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_replace.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops replace

Replace cluster resources.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_rolling-update.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops rolling-update

Rolling update a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_rolling-update_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops rolling-update cluster

Rolling update a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_toolbox.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops toolbox

Misc infrequently used commands.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_toolbox_convert-imported.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops toolbox convert-imported

Convert an imported cluster into a kops cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_toolbox_dump.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops toolbox dump

Dump cluster information
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_update.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops update

Update a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_update_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops update cluster

Update a cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_update_federation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops update federation

Update federation cluster resources.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_upgrade.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops upgrade

Upgrade a kubernetes cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_upgrade_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops upgrade cluster

Upgrade a kubernetes cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_validate.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops validate

Validate a kops cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_validate_cluster.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops validate cluster

Validate a kops cluster.
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/kops_version.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

<!--- This file is automatically generated by make gen-cli-docs; changes should be made in the go CLI command code -->
## kops version

Print the kops version information.
Expand Down

0 comments on commit d797eb1

Please sign in to comment.