1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
# mango-cobra
[](https://github.com/muesli/mango-cobra/releases)
[](https://github.com/muesli/mango-cobra/actions)
[](https://goreportcard.com/report/muesli/mango-cobra)
[](https://pkg.go.dev/github.com/muesli/mango-cobra)
cobra adapter for [mango](https://github.com/muesli/mango).
## Example
```go
import (
"fmt"
mcobra "github.com/muesli/mango-cobra"
"github.com/muesli/roff"
"github.com/spf13/cobra"
)
var (
rootCmd = &cobra.Command{
Use: "mango",
Short: "A man-page generator",
}
)
func main() {
manPage, err := mcobra.NewManPage(1, rootCmd)
if err != nil {
panic(err)
}
manPage = manPage.WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
"Released under MIT license.")
fmt.Println(manPage.Build(roff.NewDocument()))
}
```
|