mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
f1cf0ba785
closes #269
27 lines
583 B
Go
27 lines
583 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
mcobra "github.com/muesli/mango-cobra"
|
|
"github.com/muesli/roff"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var manCmd = &cobra.Command{
|
|
Use: "man",
|
|
Short: "Generates manpages",
|
|
SilenceUsage: true,
|
|
DisableFlagsInUseLine: true,
|
|
Hidden: true,
|
|
Args: cobra.NoArgs,
|
|
RunE: func(*cobra.Command, []string) error {
|
|
manPage, err := mcobra.NewManPage(1, rootCmd)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = fmt.Fprint(os.Stdout, manPage.Build(roff.NewDocument()))
|
|
return err
|
|
},
|
|
}
|