mirror of
https://github.com/spf13/cobra.git
synced 2024-11-15 09:48:19 -07:00
edcf765d9f
We previously had this weak argument called projectName which let you set a single part of a man page header. Instead do the best we can if the caller doesn't pass us anything, but let the caller specify anything they want.
35 lines
538 B
Go
35 lines
538 B
Go
package cobra_test
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func ExampleCommand_GenManTree() {
|
|
cmd := &cobra.Command{
|
|
Use: "test",
|
|
Short: "my test program",
|
|
}
|
|
header := &cobra.GenManHeader{
|
|
Title: "MINE",
|
|
Section: "3",
|
|
}
|
|
cmd.GenManTree(header, "/tmp")
|
|
}
|
|
|
|
func ExampleCommand_GenMan() {
|
|
cmd := &cobra.Command{
|
|
Use: "test",
|
|
Short: "my test program",
|
|
}
|
|
header := &cobra.GenManHeader{
|
|
Title: "MINE",
|
|
Section: "3",
|
|
}
|
|
out := new(bytes.Buffer)
|
|
cmd.GenMan(header, out)
|
|
fmt.Print(out.String())
|
|
}
|