Skip to content

Latest commit

 

History

History
158 lines (104 loc) · 3.21 KB

File metadata and controls

158 lines (104 loc) · 3.21 KB

completion

Generate shell completion scripts for iics.

Completion scripts enable tab-completion of commands, subcommands, and flags in your shell. They are generated dynamically from the installed binary, so they automatically reflect the commands and flags of the version you have installed.

Synopsis

iics completion <shell>

Subcommands

Subcommand Description
bash Generate bash completion script
zsh Generate zsh completion script
fish Generate fish completion script
powershell Generate PowerShell completion script

bash

One-time load (current session only)

source <(iics completion bash)
iics completion powershell | Out-String | Invoke-Expression

Permanent installation - Linux

iics completion bash > /etc/bash_completion.d/iics

Then start a new shell or run source /etc/bash_completion.d/iics.

Permanent installation - macOS

Requires bash-completion@2 (the macOS system bash does not support dynamic completion):

brew install bash-completion@2
iics completion bash > $(brew --prefix)/etc/bash_completion.d/iics

Add to ~/.bash_profile if not already present:

[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && \
  source "$(brew --prefix)/etc/profile.d/bash_completion.sh"

zsh

One-time load (current session only)

source <(iics completion zsh)

Permanent installation

If shell completion is not already enabled, add this to ~/.zshrc:

autoload -U compinit; compinit

Then install the completion file onto your fpath:

iics completion zsh > "${fpath[1]}/_iics"

Start a new shell or reload:

source ~/.zshrc

macOS with oh-my-zsh

iics completion zsh > ~/.oh-my-zsh/completions/_iics

fish

One-time load (current session only)

iics completion fish | source

Permanent installation

iics completion fish > ~/.config/fish/completions/iics.fish

Completions are loaded automatically by fish on the next shell start.


powershell

One-time load (current session only)

iics completion powershell | Out-String | Invoke-Expression

Permanent installation

Append to your PowerShell profile (creates the file if it does not exist):

iics completion powershell >> $PROFILE

Pre-generated scripts

The completions/ directory in the repository contains pre-generated scripts for all supported shells. These are regenerated automatically when running make completions or make all, and must be kept in sync with the command set.

File Shell
completions/iics.bash bash
completions/iics.zsh zsh
completions/iics.fish fish
completions/iics.ps1 PowerShell

To regenerate after adding or changing commands:

make completions

See also

  • profile - manage connection profiles
  • login - authenticate and cache a session