github.com/argoproj/argo-cd@v1.8.7/tools/cmd-docs/main.go (about)

     1  package main
     2  
     3  import (
     4  	"log"
     5  	"os"
     6  
     7  	controller "github.com/argoproj/argo-cd/cmd/argocd-application-controller/commands"
     8  	reposerver "github.com/argoproj/argo-cd/cmd/argocd-repo-server/commands"
     9  	argocdserver "github.com/argoproj/argo-cd/cmd/argocd-server/commands"
    10  	argocdutil "github.com/argoproj/argo-cd/cmd/argocd-util/commands"
    11  	argocdcli "github.com/argoproj/argo-cd/cmd/argocd/commands"
    12  
    13  	"github.com/spf13/cobra/doc"
    14  )
    15  
    16  func main() {
    17  	// set HOME env var so that default values involve user's home directory do not depend on the running user.
    18  	os.Setenv("HOME", "/home/user")
    19  
    20  	err := doc.GenMarkdownTree(argocdcli.NewCommand(), "./docs/user-guide/commands")
    21  	if err != nil {
    22  		log.Fatal(err)
    23  	}
    24  
    25  	err = doc.GenMarkdownTree(argocdserver.NewCommand(), "./docs/operator-manual/server-commands")
    26  	if err != nil {
    27  		log.Fatal(err)
    28  	}
    29  
    30  	err = doc.GenMarkdownTree(controller.NewCommand(), "./docs/operator-manual/server-commands")
    31  	if err != nil {
    32  		log.Fatal(err)
    33  	}
    34  
    35  	err = doc.GenMarkdownTree(reposerver.NewCommand(), "./docs/operator-manual/server-commands")
    36  	if err != nil {
    37  		log.Fatal(err)
    38  	}
    39  
    40  	err = doc.GenMarkdownTree(argocdutil.NewCommand(), "./docs/operator-manual/server-commands")
    41  	if err != nil {
    42  		log.Fatal(err)
    43  	}
    44  }