mirror of
https://github.com/spf13/cobra
synced 2024-11-17 19:27:09 +00:00
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())
|
||
|
}
|