mirror of
https://github.com/Infisical/infisical.git
synced 2025-03-28 15:04:07 +00:00
36 lines
681 B
Go
36 lines
681 B
Go
/*
|
|
Copyright (c) 2023 Infisical Inc.
|
|
*/
|
|
package cmd
|
|
|
|
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 the manpages",
|
|
SilenceUsage: true,
|
|
DisableFlagsInUseLine: true,
|
|
Hidden: true,
|
|
Args: cobra.NoArgs,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
manPage, err := mcobra.NewManPage(1, rootCmd)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, err = fmt.Fprint(os.Stdout, manPage.Build(roff.NewDocument()))
|
|
return err
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(manCmd)
|
|
}
|