github carapace-sh/carapace-bin v0.22.0

latest releases: v1.0.7, v1.0.6, v1.0.5...
21 months ago

Running Man

Specs now support a run field enabling cross shell aliases and simple nested custom commands.

Run

run can either contain an alias ([command, arg1, arg2]) which bridges completion or a shell macro ($(echo example)) with custom completions / flag parsing.

name: runnable
description: runnable spec
commands:
  -  name: sub1
     description: alias
     run: "[git, log]"

  -  name: sub2
     description: shell
     run: "$(git show $1)"
     completion:
       positional:
         - - "$(git branch --format '%(refname:short)\t%(subject)\tblue')"
           - "$(git tag --format '%(refname:short)\t\tyellow')"

  -  name: sub3
     description: shell with flags
     run: "$(git log --author \"${C_FLAG_AUTHOR}\" $1)"
     flags:
       -a, --author=: limit to author
     completion:
       flag:
         author: ["$(git shortlog --summary --email HEAD | sed -e 's/^.*\t//' -e 's/ </\t</')"]
       positional:
         - - "$(git branch --format '%(refname:short)\t%(subject)\tblue')"
           - "$(git tag --format '%(refname:short)\t\tyellow')"

asciicast

PATH

carapace _carapace now prepends ${UserConfigDir}/carapace/bin to PATH unless it already exists.

In nushell this needs to be done manually (see output of carapace _carapace nushell):

let-env PATH = ($env.PATH | prepend "/home/rsteube/.config/carapace/bin")

Shim

It also creates Shims in ${UserConfigDir}/carapace/bin to execute the specs.
For unix systems this is a simple shell script, but for windows an embedded binary is used.

#!/bin/sh
carapace --run "/home/rsteube/.config/carapace/specs/runnable.yaml" "$@"

The ${UserConfigDir}/carapace/bin directory is fully managed by carapace and unrelated files within it are removed.

Nargs

Initial support for flags consuming multiple arguments as seen in argparse and various nix commands.

XDG

XDG base directories for XDG_CACHE_HOME and XDG_CONFIG_HOME are now supported.

Changelog

  • 97b1359 Merge pull request #1506 from rsteube/nix-build-nargs
  • 80b4eca Merge pull request #1507 from rsteube/update-carapace
  • 2338f3b Merge pull request #1508 from rsteube/glab-1.24.1
  • 930e129 Merge pull request #1509 from rsteube/goreleaser-1.15.0
  • 439e5d8 Merge pull request #1510 from rsteube/git-ref-action
  • 3824f5e Merge pull request #1511 from rsteube/git-fix-prefix
  • e87a678 Merge pull request #1512 from rsteube/runnable-spec
  • b593eb7 Merge pull request #1513 from rsteube/dependabot/go_modules/github.com/rsteube/carapace-0.33.4
  • 59ba571 Merge pull request #1514 from rsteube/gh-updates-v2.23.0
  • 96ededc Merge pull request #1515 from rsteube/dependabot/go_modules/golang.org/x/mod-0.8.0
  • 3a5a721 Merge pull request #1516 from honnip/master
  • a0a97ea Merge pull request #1517 from rsteube/dependabot/go_modules/github.com/rsteube/carapace-spec-0.6.2
  • a96aeb8 Merge pull request #1518 from rsteube/nushell-shim-path
  • cea2f3c Merge pull request #1519 from rsteube/go-version-1.20
  • fda9e25 Merge pull request #1520 from rsteube/dependabot/go_modules/github.com/rsteube/carapace-spec-0.6.5
  • 39f49be Merge pull request #1521 from rsteube/git-write-tree
  • 93429a1 Merge pull request #1522 from rsteube/git-show-branch
  • 3febe62 Merge pull request #1523 from rsteube/git-mergetool
  • 870f611 Merge pull request #1524 from rsteube/git-mktag
  • bccfb45 Merge pull request #1525 from rsteube/git-cherry
  • a41b9ba Merge pull request #1526 from rsteube/git-move-actions
  • 436c49a Merge pull request #1527 from rsteube/add-rust-analyzer
  • de8375f Merge pull request #1528 from rsteube/compose-updates-2.17
  • d6e9f1c Merge pull request #1530 from rsteube/add-config-env
  • 9d9356e Merge pull request #1531 from rsteube/add-conda-content-trust
  • 0a5522d added conda-content-trust
  • bfc7cbd added conda-env
  • 8a1f6a2 added rust-analyzer
  • 4687242 build(deps): bump github.com/rsteube/carapace from 0.33.1 to 0.33.4
  • e93e2e3 build(deps): bump github.com/rsteube/carapace-spec from 0.5.3 to 0.6.2
  • 0d9144e build(deps): bump github.com/rsteube/carapace-spec from 0.6.4 to 0.6.5
  • 3c463d6 build(deps): bump golang.org/x/mod from 0.7.0 to 0.8.0
  • 6228dad compose: updates from 2.17
  • 30ee35f fix: setup changes since nushell 0.72 https://www.nushell.sh/blog/2022-11-29-nushell-0.72.html
  • 6bb9982 gh: updates from v2.23.0
  • 0f66561 git: cherry
  • f3a2466 git: complete recent commits across all branches
  • 7dc8e73 git: fix head commit prefix
  • 0a49d11 git: mergetool
  • 690f9d8 git: mktag
  • 003af01 git: move actions
  • e0ee282 git: show-branch
  • c5634dc git: write-tree
  • 813b9f7 glab: updates from 1.24.1
  • 53e3398 go: add 1.20 to versions
  • 7dba349 goreleaser: updates from 1.15.0
  • 5706f4e nix-build: support nargs
  • 13a3494 nushell: update example with shim PATH
  • 60fee6f runnable spec
  • 5f1ad90 updated carapace

Don't miss a new carapace-bin release

NewReleases is sending notifications on new releases.