.github
chore(deps): bump actions/setup-go from 4 to 6example
feat: add support for examples.gitignore
Initial import.golangci-soft.yml
chore: update golangci-lint configs & workflows.golangci.yml
chore: update golangci-lint configs & workflowsgo.mod
chore(deps): bump github.com/muesli/mango-pflag from 0.1.0 to 0.2.0go.sum
chore(deps): bump github.com/muesli/mango-pflag from 0.1.0 to 0.2.0LICENSE
Initial commitmcobra.go
feat: add support for examplesREADME.md
docs: update README badgesmango-cobra
cobra adapter for mango.
Example
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()))
}