MCPcopy Index your code
hub / github.com/rilldata/rill / printOptions

Function printOptions

cli/cmd/docs/generate_cli.go:193–210  ·  view source on GitHub ↗
(buf *bytes.Buffer, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

191}
192
193func printOptions(buf *bytes.Buffer, cmd *cobra.Command) error {
194 flags := cmd.NonInheritedFlags()
195 flags.SetOutput(buf)
196 if flags.HasAvailableFlags() {
197 buf.WriteString("### Flags\n\n```\n")
198 flags.PrintDefaults()
199 buf.WriteString("```\n\n")
200 }
201
202 parentFlags := cmd.InheritedFlags()
203 parentFlags.SetOutput(buf)
204 if parentFlags.HasAvailableFlags() {
205 buf.WriteString("### Global flags\n\n```\n")
206 parentFlags.PrintDefaults()
207 buf.WriteString("```\n\n")
208 }
209 return nil
210}
211
212type byName []*cobra.Command
213

Callers 1

genMarkdownCustomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected