Documentation
¶
Index ¶
- Variables
- func Format(dir string, inplace bool, paths []string, recursive bool) error
- func FormatSourceComments(dir string, paths []string, recursive bool) error
- func Generate(dir string, manDir string, parserName string, paths []string, recursive bool) error
- func GenerateWithFS(inputFS fs.FS, writer FileWriter, dir string, manDir string, parserName string, ...) error
- func Goreleaser(dir string, githubWorkflow bool, verificationWorkflow bool) error
- func GoreleaserWithWriter(writer FileWriter, dir string, githubWorkflow bool, verificationWorkflow bool) error
- func HelpSyntax() error
- func List(dir string, parserName string, paths []string, recursive bool) error
- func ParseTemplates(fsys fs.FS) (*template.Template, error)
- func Scan(dir string, parserName string, paths []string, recursive bool) error
- func Validate(dir string, parserName string, paths []string, recursive bool) error
- type FileWriter
- type OSFileWriter
Constants ¶
This section is empty.
Variables ¶
var TemplatesFS embed.FS
Functions ¶
func Format ¶ added in v0.0.18
Format is a subcommand `gosubc format` formats the subcommand definitions Format updates the documentation comments for subcommands in the codebase to match the defined parameters and standard formatting.
Flags:
dir: --dir (default: ".") The project root directory inplace: --inplace Modify files in place paths: --path (default: nil) Paths to search for subcommands (relative to dir) recursive: --recursive (default: true) Search recursively
func FormatSourceComments ¶ added in v0.0.15
FormatSourceComments is a subcommand `gosubc format-source-comments` formats source comments to match gofmt style
Flags:
dir: --dir (default: ".") The project root directory containing go.mod paths: --path (default: nil) Paths to search for subcommands (relative to dir) recursive: --recursive (default: true) Search recursively
func Generate ¶
Generate is a subcommand `gosubc generate` generates the subcommand code
Flags:
dir: --dir (default: ".") Project root directory containing go.mod manDir: --man-dir Directory to generate man pages in optional parserName: --parser-name (default: "commentv1") Name of the parser to use paths: --path (default: nil) Paths to search for subcommands (relative to dir) recursive: --recursive (default: true) Search recursively
func GenerateWithFS ¶ added in v0.0.11
func GenerateWithFS(inputFS fs.FS, writer FileWriter, dir string, manDir string, parserName string, options *parsers.ParseOptions) error
GenerateWithFS generates code using provided FS and Writer
func Goreleaser ¶ added in v0.0.14
Goreleaser is a subcommand `gosubc goreleaser`
Flags:
dir: --dir (default: ".") githubWorkflow: --go-releaser-github-workflow (default: false) Generate GitHub Actions release workflow verificationWorkflow: --verification-workflow (default: false) Generate verification workflow
func GoreleaserWithWriter ¶ added in v0.0.14
func GoreleaserWithWriter(writer FileWriter, dir string, githubWorkflow bool, verificationWorkflow bool) error
func HelpSyntax ¶ added in v0.0.19
func HelpSyntax() error
HelpSyntax is a subcommand `gosubc syntax` that prints the available forms of function comments
func List ¶
List is a subcommand `gosubc list` lists the subcommands
Flags:
dir: --dir (default: ".") The project root directory containing go.mod parserName: --parser-name (default: "commentv1") Name of the parser to use paths: --path (default: nil) Paths to search for subcommands (relative to dir) recursive: --recursive (default: true) Search recursively
func Scan ¶ added in v0.0.18
Scan is a subcommand `gosubc scan` lists all available subcommands and their flags Scan lists all available subcommands and their flags from the parsed codebase. It is useful for verifying the command structure and configuration.
Flags:
dir: --dir (default: ".") The project root directory parserName: --parser-name (default: "commentv1") Name of the parser to use paths: --path (default: nil) Paths to search for subcommands (relative to dir) recursive: --recursive (default: true) Search recursively
func Validate ¶
Validate is a subcommand `gosubc validate` validates the subcommand code
Flags:
dir: --dir (default: ".") The project root directory containing go.mod parserName: --parser-name (default: "commentv1") Name of the parser to use paths: --path (default: nil) Paths to search for subcommands (relative to dir) recursive: --recursive (default: true) Search recursively
Types ¶
type FileWriter ¶ added in v0.0.11
type FileWriter interface {
WriteFile(path string, content []byte, perm os.FileMode) error
MkdirAll(path string, perm os.FileMode) error
}
FileWriter interface allows mocking file system writes
type OSFileWriter ¶ added in v0.0.11
type OSFileWriter struct{}
OSFileWriter implements FileWriter using os package