| 138 | } |
| 139 | |
| 140 | func 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, `--- |
| 151 | title: %q |
| 152 | linkTitle: %q |
| 153 | weight: 3 |
| 154 | --- |
| 155 | `, title, title) |
| 156 | emitFlags(f, app.Flags) |
| 157 | |
| 158 | return nil |
| 159 | } |
| 160 | |
| 161 | func generateCommands(app *kingpin.ApplicationModel, section string, weight int, advanced bool) error { |
| 162 | dir := filepath.Join(*baseDir, section) |