Generate Markdown docs (#414)

* Generate Markdown docs

This is largely copied from similar work in go-containerregistry

This required moving the Root command definition out of main() into a
place where it could be referenced from the gendoc tooling.

* fix boilerplate

* moar fix boilerplate

* update cmd/ko/main.go

* set -j to GOMAXPROCS at runtime

* rebase on cli-runtime change

* remove trailing whitespace
This commit is contained in:
Jason Hall
2021-08-11 13:54:13 -07:00
committed by GitHub
parent 86a7b6f4b8
commit 780c281292
52 changed files with 10556 additions and 100 deletions
+1 -25
View File
@@ -20,10 +20,7 @@ import (
"log"
"os"
cranecmd "github.com/google/go-containerregistry/cmd/crane/cmd"
"github.com/google/go-containerregistry/pkg/logs"
"github.com/spf13/cobra"
"github.com/google/ko/pkg/commands"
)
@@ -31,28 +28,7 @@ func main() {
logs.Warn.SetOutput(os.Stderr)
logs.Progress.SetOutput(os.Stderr)
// Parent command to which all subcommands are added.
cmds := &cobra.Command{
Use: "ko",
Short: "Rapidly iterate with Go, Containers, and Kubernetes.",
SilenceUsage: true, // Don't show usage on errors
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
commands.AddKubeCommands(cmds)
// Also add the auth group from crane to facilitate logging into a
// registry.
authCmd := cranecmd.NewCmdAuth("ko", "auth")
// That was a mistake, but just set it to Hidden so we don't break people.
authCmd.Hidden = true
cmds.AddCommand(authCmd)
// Just add a `ko login` command:
cmds.AddCommand(cranecmd.NewCmdAuthLogin())
if err := cmds.Execute(); err != nil {
if err := commands.Root.Execute(); err != nil {
log.Fatal("error during command execution:", err)
}
}