From 6f515ded8ff4e19d29ae9b13b85f9a7e57c77287 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:25:22 +0200 Subject: [PATCH] docs: move the link to global flags page to the main options header --- cmd/gendocs/gendocs.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/gendocs/gendocs.go b/cmd/gendocs/gendocs.go index f9bc6b1f6..9ad95a358 100644 --- a/cmd/gendocs/gendocs.go +++ b/cmd/gendocs/gendocs.go @@ -190,21 +190,21 @@ rclone.org website.`, } else { var out strings.Builder if groupsString := cmd.Annotations["groups"]; groupsString != "" { + _, _ = out.WriteString("Options shared with other commands are described next.\n") + _, _ = out.WriteString("See the [global flags page](/flags/) for global options not listed here.\n\n") groups := flags.All.Include(groupsString) for _, group := range groups.Groups { if group.Flags.HasFlags() { - _, _ = fmt.Fprintf(&out, "\n#### %s Options\n\n", group.Name) + _, _ = fmt.Fprintf(&out, "#### %s Options\n\n", group.Name) _, _ = fmt.Fprintf(&out, "%s\n\n", group.Help) - _, _ = fmt.Fprintln(&out, "```") + _, _ = out.WriteString("```\n") _, _ = out.WriteString(group.Flags.FlagUsages()) - _, _ = fmt.Fprintln(&out, "```") + _, _ = out.WriteString("```\n\n") } } + } else { + _, _ = out.WriteString("See the [global flags page](/flags/) for global options not listed here.\n\n") } - _, _ = out.WriteString(` -See the [global flags page](/flags/) for global options not listed here. - -`) doc = doc[:startCut] + out.String() + "### See Also" + doc[endCut+12:] }