cli

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cli provides the command-line interface logic for db-catalyst.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Usage

func Usage(fs *flag.FlagSet) string

Usage returns the usage string for the command-line interface.

Types

type Options

type Options struct {
	ConfigPath          string
	Out                 string
	DryRun              bool
	ListQueries         bool
	StrictConfig        bool
	Verbose             bool
	NoJSONTags          bool
	EmitJSONTags        bool
	EmitPointersForNull bool
	SQLDialect          string
	SQLOutput           bool
	EmitIFNotExists     bool
	ClearCache          bool
	Database            string
	Verify              bool
	// Check subcommand fields.
	Check      bool
	CheckSQL   string // --sql flag value
	CheckStdin bool   // --stdin flag: read query from stdin
	// MCP subcommand: start the stdio JSON-RPC 2.0 MCP server.
	MCP bool
	// Vet subcommand: run query lint rules.
	Vet bool
	// Suggest enables opt-in LLM-assisted repair hints on the check subcommand.
	// Suggestions are printed to STDERR only and never affect generate output.
	Suggest bool
	// Format controls the output format for diagnostics.
	// Accepted values: "" (same as "text"), "text", "json".
	Format string
	Args   []string
}

Options holds the configuration derived from command-line arguments.

func Parse

func Parse(args []string) (Options, error)

Parse processes command-line arguments and returns the options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL