github carapace-sh/carapace-bin v0.12.1

latest releases: v1.0.7, v1.0.6, v1.0.5...
2 years ago

Spec Autoloading

Specs placed in ${UserConfigDir}/carapace/specs/ (UserConfigDir) are now registered with carapace _carapace.
File name must be the command to be completed and match ^[0-9a-zA-Z_\-.]+\.yaml$ (sanity check to avoid breakage in scripts).

Custom Macros

Exposed actions as custom macros (list with carapace --macros).
Removed the _ prefix from core macros to avoid clashes (e.g. $files, $directories).

Macro Arguments

Arguments are parsed as yaml ($macro(yaml) - e.g.: $_tools.gh.Users({users: true})).
Brackets are optional when no argument is passed ($files instead of $files()).

Variable Substitution

Variables are replaced using drone/envsubst for contextual completion:

name: myzip
completion:
  positional:
    - ["$files([.zip])"] # ${C_ARG0}
  positionalany: ["$_fs.ZipFileContents(${C_ARG0})"] # ${C_ARG1},${C_ARG2},...

Flags are only added to env when their value changed (thus: ${C_FLAG_FLAGNAME:-default}):

name: myrefs
flags:
  --tags: list tags # ${C_FLAG_TAGS}
  --localbranches: list local branches # ${C_FLAG_LOCALBRANCHES}
  --commits=: amount of commits # ${C_FLAG_COMMITS}
completion:
  positional:
    - ["$_tools.git.Refs({tags: ${C_FLAG_TAGS:-false}, localbranches: ${C_FLAG_LOCALBRANCHES:-false}, commits: ${C_FLAG_COMMITS:-0}})"] # refs based on flag values with defaults
    - ["$_tools.git.Refs"] # default refs
    - ["$(env)"] # env

Changelog

  • 4c1adb5 Merge pull request #1083 from rsteube/custom-macros
  • c15cc7b Merge pull request #1085 from rsteube/actions-http
  • 86282ef Merge pull request #1087 from rsteube/macros
  • a70de34 Merge pull request #1089 from rsteube/actions-gh-signature
  • 77209c6 actions: remove http prefix
  • 60f5609 actions: tools.gh.ActionUsers macro signature
  • 7806533 added custom macros
  • 3e442f8 spec: expose Actions as custom macros

Don't miss a new carapace-bin release

NewReleases is sending notifications on new releases.