MCPcopy Index your code
hub / github.com/cli/cli / printFlagsHTML

Function printFlagsHTML

internal/docs/markdown.go:113–130  ·  view source on GitHub ↗
(w io.Writer, fs *pflag.FlagSet)

Source from the content-addressed store, hash-verified

111var tpl = template.Must(template.New("flags").Parse(flagsTemplate))
112
113func printFlagsHTML(w io.Writer, fs *pflag.FlagSet) error {
114 var flags []flagView
115 fs.VisitAll(func(f *pflag.Flag) {
116 if f.Hidden || f.Name == "help" {
117 return
118 }
119 varname, usage := pflag.UnquoteUsage(f)
120
121 flags = append(flags, flagView{
122 Name: f.Name,
123 Varname: varname,
124 Shorthand: f.Shorthand,
125 DefValue: getDefaultValueDisplayString(f),
126 Usage: usage,
127 })
128 })
129 return tpl.Execute(w, flags)
130}
131
132// genMarkdownCustom creates custom markdown output.
133func genMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error {

Callers 2

printOptionsFunction · 0.85

Calls 1

Tested by 1