Files
gitea-tea/docs/docs.go
Valentin Brandl 4f513ca3e3 generate man page (#811)
[CLI.md](src/branch/main/docs/CLI.md) already gets generated using `urfave/cli-docs`. `cli-docs` can also generate man pages.

This change extends the doc generator to also generate a man page for `tea`.

* Add a subcommand to the doc generator to print the generated man page to stdout

Closes #777.

Co-authored-by: Valentin Brandl <mail@vbrandl.net>
Reviewed-on: https://gitea.com/gitea/tea/pulls/811
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: TheFox0x7 <thefox0x7@noreply.gitea.com>
Co-authored-by: Valentin Brandl <vbrandl@noreply.gitea.com>
Co-committed-by: Valentin Brandl <vbrandl@noreply.gitea.com>
2025-09-14 00:17:28 +00:00

29 lines
606 B
Go

// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
//go:generates
package main
import (
"context"
"os"
"code.gitea.io/tea/cmd"
docs "github.com/urfave/cli-docs/v3"
"github.com/urfave/cli/v3"
)
// CmdDocs generates markdown for tea
func main() {
cli := &cli.Command{
Name: "docs",
Hidden: true,
Description: "Generate CLI docs",
Flags: cmd.DocRenderFlags,
Action: func(ctx context.Context, params *cli.Command) error {
return cmd.RenderDocs(params, cmd.App(), docs.ToMarkdown)
},
}
cli.Run(context.Background(), os.Args)
}