1package doc_test 2 3import ( 4 "bytes" 5 "fmt" 6 7 "github.com/spf13/cobra" 8 "github.com/spf13/cobra/doc" 9) 10 11func ExampleGenManTree() { 12 cmd := &cobra.Command{ 13 Use: "test", 14 Short: "my test program", 15 } 16 header := &doc.GenManHeader{ 17 Title: "MINE", 18 Section: "3", 19 } 20 doc.GenManTree(cmd, header, "/tmp") 21} 22 23func ExampleGenMan() { 24 cmd := &cobra.Command{ 25 Use: "test", 26 Short: "my test program", 27 } 28 header := &doc.GenManHeader{ 29 Title: "MINE", 30 Section: "3", 31 } 32 out := new(bytes.Buffer) 33 doc.GenMan(cmd, header, out) 34 fmt.Print(out.String()) 35} 36