https://github.com/muesli/mango-cobra
cobra adapter for mango
https://github.com/muesli/mango-cobra
Last synced: 6 months ago
JSON representation
cobra adapter for mango
- Host: GitHub
- URL: https://github.com/muesli/mango-cobra
- Owner: muesli
- License: mit
- Created: 2022-02-01T00:35:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-04T23:59:34.000Z (about 2 years ago)
- Last Synced: 2024-12-10T05:51:40.492Z (6 months ago)
- Language: Go
- Size: 45.9 KB
- Stars: 32
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 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()))
}
```