mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
Vendor libraries for github.com/spf13/cobra
This commit is contained in:
committed by
Zlatko Čalušić
parent
e945404183
commit
6bee34700d
26
vendor/github.com/spf13/cobra/doc/man_docs.md
generated
vendored
Normal file
26
vendor/github.com/spf13/cobra/doc/man_docs.md
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generating Man Pages For Your Own cobra.Command
|
||||
|
||||
Generating man pages from a cobra command is incredibly easy. An example is as follows:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/cobra/doc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd := &cobra.Command{
|
||||
Use: "test",
|
||||
Short: "my test program",
|
||||
}
|
||||
header := &doc.GenManHeader{
|
||||
Title: "MINE",
|
||||
Section: "3",
|
||||
}
|
||||
doc.GenManTree(cmd, header, "/tmp")
|
||||
}
|
||||
```
|
||||
|
||||
That will get you a man page `/tmp/test.3`
|
||||
Reference in New Issue
Block a user