cli

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package cli implements the command-line interface for dotgen.

Index

Constants

View Source
const DefaultPath = "**/*.dotgen"

DefaultPath is the default glob pattern for dotgen configuration files.

Variables

View Source
var ErrExitGracefully = errors.New("exit gracefully")

ErrExitGracefully is used to signal a graceful exit without error.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI represents the command-line interface.

func New

func New(version string) CLI

New creates a new CLI instance with the given version.

func (CLI) Execute

func (c CLI) Execute() error

Execute runs the CLI with the provided arguments.

type Logger

type Logger struct {
	// Verbose indicates whether verbose logging is enabled.
	Verbose bool
}

Logger represents a simple logger with verbosity control.

func (Logger) Printlnf

func (l Logger) Printlnf(format string, args ...any)

Printlnf prints a formatted message to stderr if Verbose is true.

type Options

type Options struct {
	// Input represents input file paths or patterns.
	Input []string
	// Shell represents the active shell.
	Shell string
	// Values represents additional YAML value files.
	Values []string
	// Set represents variables to set or override (key=value).
	Set []string
	// Verbose represents whether verbose output is enabled.
	Verbose bool
	// Debug represents whether debug output is enabled.
	Debug bool
	// Instrument represents whether instrumentation for profiling is enabled.
	Instrument bool
	// Hash represents whether to compute and print a hash of all included files.
	Hash bool
	// Dry represents whether to show which files would be included, but not execute commands.
	Dry bool
	// Version represents whether to show the version and exit.
	Version bool
}

Options represents the CLI options.

Jump to

Keyboard shortcuts

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