Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CLI ¶
CLI generates CLI boilerplate Go files from the given OpenCLI document. It returns a map of relative file paths to their generated byte content. All generated files are placed under the gencli/ directory and belong to a single gencli package, so no cross-package import paths are required.
Types ¶
type CLIFramework ¶
type CLIFramework string
CLIFramework is the target framework for CLI code generation.
const ( // CobraFramework generates code for the github.com/spf13/cobra framework. CobraFramework CLIFramework = "COBRA" // YargsFramework generates code for the yargs Node.js framework. YargsFramework CLIFramework = "YARGS" // UrfaveCliFramework generates code for the github.com/urfave/cli/v3 framework. UrfaveCliFramework CLIFramework = "URFAVECLI" )
func (CLIFramework) IsValid ¶
func (f CLIFramework) IsValid() bool
IsValid reports whether f is a supported CLIFramework.
type GenCLIOption ¶
type GenCLIOption func(*genCLIOptions)
GenCLIOption is a functional option to configure the CLI function.
func GenCLIWithFramework ¶
func GenCLIWithFramework(f CLIFramework) GenCLIOption
GenCLIWithFramework sets the target CLI framework.
type GenDocsOption ¶
type GenDocsOption func(*genDocsOptions)
GenDocsOption is a functional option to configure the GenDocs function
func DocsWithFormat ¶
func DocsWithFormat(format DocFormat) GenDocsOption
DocsWithFormat sets the desired output format of the documentation.
func DocsWithoutBadge ¶
func DocsWithoutBadge() GenDocsOption
DocsWithoutBadge option will remove shields.io badge that indicates compliance with the OpenCLI Spec prepended to markdown documents by default.
func DocsWithoutFooter ¶
func DocsWithoutFooter() GenDocsOption
DocsWithoutFooter option will remove the `generated by OpenCLI` footer appended to the documents by default.