Skip to content
Myr

fix: correct command path in see_also for YAML doc (#1771)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The `see_also` section for child commands would include only the name of the commands. This adds the whole path, similar to how it's done for the other documentation formats.

authored by Zoran Regvart · committed by GitHub · parent 6bf8cd8 · Browse files · 2 files+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−1 removed

  • other:+3 added−1 removed

2 files+3 added−1 removed

modified:doc/yaml_docs_test.go+2 added
1package doc23import (4 "bytes"5 "fmt"6 "io/ioutil"7 "os"8 "path/filepath"9 "testing"
14 unmodified lines
24 checkStringContains(t, output, "boolone")25 checkStringContains(t, output, "rootflag")26 checkStringContains(t, output, rootCmd.Short)27 checkStringContains(t, output, echoSubCmd.Short)28 checkStringContains(t, output, fmt.Sprintf("- %s - %s", echoSubCmd.CommandPath(), echoSubCmd.Short))29}3031func TestGenYamlNoTag(t *testing.T) {32 rootCmd.DisableAutoGenTag = true
55 unmodified lines
modified:doc/yaml_docs.go+1 added-1 removed
126 unmodified lines
127 for _, child := range children {128 if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {129 continue130 }131 result = append(result, child.Name()+" - "+child.Short)131 result = append(result, child.CommandPath()+" - "+child.Short)132 }133 yamlDoc.SeeAlso = result134 }135
39 unmodified lines