cmdbase

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyParams added in v1.2.0

func ApplyParams(p *Params)

ApplyParams applies CLI logging flags. Call at the start of every command.

func Run added in v1.2.0

func Run(c boa.CmdIfc)

Run executes a boa command without dumping cobra usage/help on error. boa.Cmd.Run always prints UsageString() before the error — including for runtime failures from RunFuncE — which dumps every config flag on crash. --help still works. Failures print "Error: ..." to stderr and exit 1.

Types

type Params

type Params struct {
	ConfigFile string `configfile:"true" optional:"true" default:"/etc/dnsmgr2/dnsmgr2.yaml"`
	Debug      bool   `descr:"Enable verbose debug logging" short:"d"`
	Loglevel   string `descr:"Set log level" alts:"error,warning,info,debug" default:"info"`
	// Config is YAML-only. boa:"ignore" keeps nested slices such as
	// dhcp.dns_servers from becoming required CLI flags (missing
	// config-dhcpdns-servers) when the key is omitted; prefixes may
	// supply per-subnet servers instead.
	Config dnsmgr.ConfigRoot `yaml:",inline" boa:"ignore"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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