mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-09-13 06:59:07 +00:00
fix doc links, update README.md
This commit is contained in:
parent
664d02f8ea
commit
ecbb7c88cd
2 changed files with 57 additions and 2 deletions
12
cmd/doc.go
12
cmd/doc.go
|
@ -2,6 +2,8 @@ package cmd
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/cobra/doc"
|
||||
|
@ -19,7 +21,7 @@ var genDocCmd = &cobra.Command{
|
|||
rootCmd.DisableAutoGenTag = true
|
||||
switch docType {
|
||||
case "markdown":
|
||||
return doc.GenMarkdownTree(rootCmd, "doc")
|
||||
return doc.GenMarkdownTreeCustom(rootCmd, "doc", filePrepender, linkHandler)
|
||||
case "man":
|
||||
return doc.GenManTree(rootCmd, nil, "man")
|
||||
default:
|
||||
|
@ -32,3 +34,11 @@ func init() {
|
|||
rootCmd.AddCommand(genDocCmd)
|
||||
genDocCmd.Flags().StringP("type", "t", "markdown", "what to generate, markdown or man")
|
||||
}
|
||||
|
||||
func filePrepender(name string) string {
|
||||
return name
|
||||
}
|
||||
|
||||
func linkHandler(name string) string {
|
||||
return strings.TrimSuffix(name, path.Ext(name))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue