1# mango-pflag
2
3[](https://github.com/muesli/mango-pflag/releases)
4[](https://github.com/muesli/mango-pflag/actions)
5[](https://goreportcard.com/report/muesli/mango-pflag)
6[](https://pkg.go.dev/github.com/muesli/mango-pflag)
7
8pflag adapter for [mango](https://github.com/muesli/mango).
9
10## Example
11
12```go
13import (
14 "fmt"
15
16 "github.com/muesli/mango"
17 mpflag "github.com/muesli/mango-pflag"
18 "github.com/muesli/roff"
19 flag "github.com/spf13/pflag"
20)
21
22func main() {
23 flag.Parse()
24
25 manPage := mango.NewManPage(1, "mango", "a man-page generator").
26 WithLongDescription("mango is a man-page generator for Go.").
27 WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
28 "Released under MIT license.")
29
30 flag.VisitAll(mpflag.PFlagVisitor(manPage))
31 fmt.Println(manPage.Build(roff.NewDocument()))
32}
33```