muesli / mango-cobra

cobra adapter for mango

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mango-cobra

Latest Release Build Status Go ReportCard GoDoc

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()))
}

About

cobra adapter for mango

License:MIT License


Languages

Language:Go 100.0%