Blame SOURCES/0001-hack-to-generate-man-pages.patch

62780e
diff -up etcd-3.4.13/etcdctl/ctlv2/ctl.go.orig2 etcd-3.4.13/etcdctl/ctlv2/ctl.go
62780e
--- etcd-3.4.13/etcdctl/ctlv2/ctl.go.orig2	2020-08-24 21:11:28.000000000 +0200
62780e
+++ etcd-3.4.13/etcdctl/ctlv2/ctl.go	2020-09-04 00:13:47.552811076 +0200
62780e
@@ -36,6 +36,68 @@ func Start() {
62780e
 	}
62780e
 	app.Usage = "A simple command line client for etcd."
62780e
 
62780e
+	cli.AppHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017"  ""
62780e
+.SH NAME:
62780e
+{{.Name}} - {{.Usage}}
62780e
+
62780e
+{{if .Version}}
62780e
+.SH VERSION:
62780e
+   {{.Version}}
62780e
+{{end}}
62780e
+
62780e
+.SH USAGE:
62780e
+   {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
62780e
+   {{if .Commands}}
62780e
+
62780e
+.SH COMMANDS:
62780e
+{{range .Commands}}{{if not .HideHelp}}\fB{{ .Name }}\fP{{ "\n\t\t\t" }}{{.Usage}}{{ "\n" }}
62780e
+
62780e
+{{end}}{{end}}{{end}}{{if .VisibleFlags}}
62780e
+
62780e
+.SH GLOBAL OPTIONS:
62780e
+{{range .VisibleFlags}}{{ . }}
62780e
+
62780e
+{{end}}{{end}}
62780e
+
62780e
+.SH SEE ALSO
62780e
+{{range .Commands}}{{if not .HideHelp}}{{if ne .Name "help" }}\fBetcdctl-{{ .Name }}(1)\fP,
62780e
+{{end}}{{end}}{{end}}
62780e
+`
62780e
+
62780e
+	cli.CommandHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017"  ""
62780e
+.SH NAME:
62780e
+   {{.HelpName}} - {{.Usage}}
62780e
+
62780e
+.SH USAGE:
62780e
+   {{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
62780e
+
62780e
+{{if .VisibleFlags}}
62780e
+.SH OPTIONS:
62780e
+   {{range .VisibleFlags}}{{.}}
62780e
+   {{end}}{{end}}
62780e
+`
62780e
+
62780e
+
62780e
+	cli.SubcommandHelpTemplate = `.TH "ETCD" "1" " etcd User Manuals" "Etcd contributors" "Nov 2017"  ""
62780e
+.SH NAME:
62780e
+   {{.HelpName}} - {{.Usage}}
62780e
+
62780e
+.SH USAGE:
62780e
+   {{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
62780e
+
62780e
+.SH COMMANDS:
62780e
+{{range .VisibleCategories}}{{if .Name}}
62780e
+{{.Name}}:{{end}}{{range .VisibleCommands}}
62780e
+\fB{{ .Name }}\fP{{"\n\t\t\t"}}{{.Usage}}{{ "\n" }}{{end}}
62780e
+{{end}}
62780e
+
62780e
+{{if .VisibleFlags}}
62780e
+.SH OPTIONS:
62780e
+{{range .VisibleFlags}}{{.}}
62780e
+{{end}}{{end}}
62780e
+`
62780e
+
62780e
+
62780e
 	app.Flags = []cli.Flag{
62780e
 		cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"},
62780e
 		cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"},
62780e
diff -up etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go.orig2 etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go
62780e
--- etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go.orig2	2020-08-24 21:11:28.000000000 +0200
62780e
+++ etcd-3.4.13/etcdctl/ctlv3/ctl_nocov.go	2020-09-04 00:13:47.553811076 +0200
62780e
@@ -16,13 +16,20 @@
62780e
 
62780e
 package ctlv3
62780e
 
62780e
-import "go.etcd.io/etcd/etcdctl/ctlv3/command"
62780e
+//import "github.com/coreos/etcd/etcdctl/ctlv3/command"
62780e
+import cobra "github.com/spf13/cobra/doc"
62780e
 
62780e
 func Start() {
62780e
 	rootCmd.SetUsageFunc(usageFunc)
62780e
 	// Make help just show the usage
62780e
 	rootCmd.SetHelpTemplate(`{{.UsageString}}`)
62780e
-	if err := rootCmd.Execute(); err != nil {
62780e
-		command.ExitWithError(command.ExitError, err)
62780e
+	//if err := rootCmd.Execute(); err != nil {
62780e
+	//	command.ExitWithError(command.ExitError, err)
62780e
+	//}
62780e
+	header := &cobra.GenManHeader{
62780e
+		Title: "etcdctl3",
62780e
+		Section: "1",
62780e
 	}
62780e
+
62780e
+	cobra.GenManTree(rootCmd, header, "")
62780e
 }
62780e
diff -up etcd-3.4.13/vendor/github.com/urfave/cli/flag.go.orig2 etcd-3.4.13/vendor/github.com/urfave/cli/flag.go
62780e
--- etcd-3.4.13/vendor/github.com/urfave/cli/flag.go.orig2	2020-08-24 21:11:28.000000000 +0200
62780e
+++ etcd-3.4.13/vendor/github.com/urfave/cli/flag.go	2020-09-04 00:13:47.555811078 +0200
62780e
@@ -670,7 +670,7 @@ func prefixedNames(fullName, placeholder
62780e
 	parts := strings.Split(fullName, ",")
62780e
 	for i, name := range parts {
62780e
 		name = strings.Trim(name, " ")
62780e
-		prefixed += prefixFor(name) + name
62780e
+		prefixed += "\\fB" + prefixFor(name) + name + "\\fP"
62780e
 		if placeholder != "" {
62780e
 			prefixed += " " + placeholder
62780e
 		}
62780e
@@ -745,7 +745,7 @@ func stringifyFlag(f Flag) string {
62780e
 	usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultValueString))
62780e
 
62780e
 	return withEnvHint(fv.FieldByName("EnvVar").String(),
62780e
-		fmt.Sprintf("%s\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault))
62780e
+		fmt.Sprintf("%s\n\t\t\t%s", prefixedNames(fv.FieldByName("Name").String(), placeholder), usageWithDefault))
62780e
 }
62780e
 
62780e
 func stringifyIntSliceFlag(f IntSliceFlag) string {