//go:build docs// +build docspackagemainimport("os""regexp""strings""go.jolheiser.com/tmpl/cmd")//go:generate go run cli.gofuncmain(){app:=cmd.NewApp()fi,err:=os.Create("CLI.md")iferr!=nil{panic(err)}deferfi.Close()md,err:=app.ToMarkdown()iferr!=nil{panic(err)}// CLI ToMarkdown issue related to man-pagesmd=md[strings.Index(md,"#"):]// CLI is using real default instead of DefaultTextmd=regexp.MustCompile(`[\/\\:\w]+\.tmpl`).ReplaceAllString(md,"~/.tmpl")if_,err:=fi.WriteString(md);err!=nil{panic(err)}}