lazycomplete

command module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 5 Imported by: 0

README

lazycomplete

Lazy loading for shell completion scripts.

A lot of programs provide their own shell completion script by invoking them with a specific argument like mybinary completion. The easiest way to use it is to add the call to the shell init script (like .bashrc) which keeps the completion up to date. Add a couple of these and shell startup time is affected considerably though as a single invocation and subsequent parsing can take ~50-100ms. This tool generates a lazy loading script for given binaries where the actual completion script is resolved only when needed.

Status

WIP

Usage

Invoke with pairs of binary name and command to be invoked to create the completion:

# bash
source <(lazycomplete \
  gh 'gh _carapace' \
  lab 'lab _carapace' \
)

# elvish
eval (lazycomplete ^
  gh 'gh _carapace' ^
  lab 'lab _carapace' ^
|slurp)


# fish
lazycomplete \
  gh 'gh _carapace' \
  lab 'lab _carapace' \
| source

# oil
source <(lazycomplete \
  gh 'gh _carapace' \
  lab 'lab _carapace' \
)

# powershell
lazycomplete `
  gh 'gh _carapace' `
  lab 'lab _carapace' `
| Out-String | Invoke-Expression

# xonsh
exec($(lazycomplete \
  gh 'gh _carapace' \
  lab 'lab _carapace' \
))

# zsh
source <(lazycomplete \
  gh 'gh _carapace' \
  lab 'lab _carapace' \
)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ps

Jump to

Keyboard shortcuts

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