Skip to content

v0.11.0

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Nov 19:36
Immutable release. Only release title and notes can be modified.
2d09f40

CONGA v0.11.0 makes completion follow each field's declaration more closely: an enum narrows the field's predictor, map values complete from their value type, and a type's Predict runs only when the shell completes that field. Programs that declare enum on path fields now fail at startup.

🚀 Highlights

  • enum narrows completion: A field with an enum tag offers only the enum values, drawn from its predictor so they keep their descriptions and order. system.Signal with enum:"TERM,INT,HUP" now offers three signals instead of every spelling of every signal. The new predict.Predictor.Include exposes the same filter to predictor authors (#218, closes #128).
  • Map values complete: Map flags and positionals complete the value after key= from the value type's predictor, so map[string]*time.Location with timezone.RegisterLocation offers time zones after eu=. A map without help names its value type in the hint, such as <key>=<Path to a file> (#223, closes #217).
  • Predict runs only when needed: With completion enabled, ordinary runs, --help and --why no longer call every type's Predict. A completion request calls it only for the field being completed (#222, closes #129).

⚠ Breaking Changes & Migration

  • enum on path fields fails at startup (#221): Schema build rejects enum with ErrSchema on conga.File, conga.Dir, conga.FileContent (including slices and pointers of them), on types implementing predict.FileFilterable, DirFilterable or PathFilterable, and on fields with a file, dir, exec or symlink predictor. Remove enum, use glob on conga.File, or use a string field with enum and no path predictor. conga-lint reports the same error.

✨ Features

  • completion: Add predict.Predictor.Include(values ...string), and narrow a field's predictor to its enum values (#218).
  • completion: Complete map values from their value type. Entries split at the first = as the run does, predictor:"file" (or dir, exec, symlink) on a map completes the value after key=, and slice and map element predictors keep a timeout raised with Timeout(d) (#223).

🐛 Bug Fixes

  • completion: Call a type's Predict only when completing that field. In programs with completion enabled, a panicking Predict now fails only that field's completion request (exit 2) instead of crashing every run (#222).
  • completion: Slice completion keeps envs/dev.yaml after dev.yaml was given. predict.Predictor.Exclude and Raw now compare each candidate's Value after Prefix and Suffix, never Display; on a MultiParts predictor, call Exclude on the predictor the segment function returns (#218).
  • completion: Finished segmented values such as --image api-gateway:v3.2.0 and later list elements get a trailing space, and Timeout alternatives keep their own modifiers (#218).
  • lint: Report the map tag rules (no enum, range or len on a map, string keys only) as the program does, stop reporting domain tags such as existing:"true" on OptionalFlag[*conga.File] as unknown, and report range on a map with the program's message (#221).

Full Changelog: v0.10.0...v0.11.0

Requirements: Go 1.27+ · Docs · pkg.go.dev