Repository navigation
v0.4.0
Immutable
release. Only release title and notes can be modified.
CONGA v0.4.0 wraps help to the terminal width, adds oneof flag groups and short flags for the built-in help and version flags, and names completion environment variables after the application.
🚀 Highlights
- Help wrapping: Help output wraps to
COLUMNS, the terminal width, or 100 columns, and aligns columns by terminal cell width (#88). oneofflag groups: Exactly one member of aoneofgroup must be set. Usage shows the group as(--input-file=PATH | --input-url=URL), and completion hides the other members once one is given (#88).- Built-in short flags:
App.HelpShortFlagandApp.VersionShortFlagbind a short rune to--helpand--version(#88). - App-named completion variables: Completion toggles are read from
<APP>_COMPLETION_*, andconga.CompletionEnvPrefixoverrides the prefix (#82).
⚠ Breaking Changes & Migration
API changes
WhyJSONandRegisterTypeOptionrenamed (#84):- Replace
conga.WhyJSON()withconga.WhyOptionJSON()and theconga.RegisterTypeOptiontype withconga.RegistrationOption.
- Replace
Schema & startup guards
RequiredFlagrejectsdefaultandxor(#88):- Either tag on a
RequiredFlagfails schema build withErrSchema. UseOptionalFlagfields in aoneofgroup instead.
- Either tag on a
congadirectives removed (#88):conga:"ignore"andconga:"-"no longer exclude a field. Plain fields that are not containers need no tag. Remove from the struct any container field CONGA should skip.- Any remaining
congatag is an unknown tag and fails schema build withErrSchemaunless allowed withapp.AllowTags("conga").
Configuration
- Completion environment variables named after the application (#82, closes #81):
CONGA_COMPLETION_ALIASESandCONGA_COMPLETION_DESCRIPTIONSare now<APP>_COMPLETION_ALIASESand<APP>_COMPLETION_DESCRIPTIONS, where<APP>is the application name in upper snake case. Rename them in shell configuration, or passconga.CompletionEnvPrefix(...)toEnableCompletionto choose the prefix.
✨ Features
- cli: Wrap help output to the terminal width and align tables by terminal cell width (#88).
- cli: Add
oneofgroups for exactly-one flag sets (#88). - cli: Add
App.HelpShortFlagandApp.VersionShortFlagfor built-in short flags; collisions with declared shorts fail schema build (#88). - cli: Help, usage, and version output use the configured application name instead of the invoked binary name (#88).
- completion: Read completion toggles from application-prefixed variables and add
conga.CompletionEnvPrefix(#82, closes #81). - completion: Offer flags only after
-in every shell, not at a bare space; set<APP>_COMPLETION_BARE_SPACE_FLAGSor thebare-space-flagszstyle to restore them. Zsh also resolves~namenamed directories (#86).
Full Changelog: v0.3.0...v0.4.0
Requirements: Go 1.27+ · Docs · pkg.go.dev