MCPcopy
hub / github.com/kopia/kopia / generateAppFlags

Function generateAppFlags

tools/cli2md/cli2md.go:140–159  ·  view source on GitHub ↗
(app *kingpin.ApplicationModel)

Source from the content-addressed store, hash-verified

138}
139
140func generateAppFlags(app *kingpin.ApplicationModel) error {
141 f, err := os.Create(filepath.Join(*baseDir, "flags.md"))
142 if err != nil {
143 return errors.Wrap(err, "unable to create common flags file")
144 }
145 defer f.Close() //nolint:errcheck
146
147 title := "Flags"
148
149 //nolint:errcheck
150 fmt.Fprintf(f, `---
151title: %q
152linkTitle: %q
153weight: 3
154---
155`, title, title)
156 emitFlags(f, app.Flags)
157
158 return nil
159}
160
161func generateCommands(app *kingpin.ApplicationModel, section string, weight int, advanced bool) error {
162 dir := filepath.Join(*baseDir, section)

Callers 1

mainFunction · 0.85

Calls 2

emitFlagsFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected