shell completions#
Description#
The completion
command generates shell completions for bash/zsh/fish shells.
Usage#
containerlab completion [arg]
Bash completions#
Ensure that bash-completion is installed on your system.
To load completions for the current session:
To load completions for each session:
To also autocomplete for clab
command alias, add the following to your .bashrc
or .bash_profile
:
ZSH completions#
If shell completion is not already enabled in your environment you have to enable it by ensuring zsh completions are loaded. The following can be added to your zshrc:
To load completions for each session generate the completion script and store it somewhere in your $fpath
:
clab completion zsh | \
sed '1,2c\#compdef containerlab clab\ncompdef _containerlab containerlab clab' > \
~/.oh-my-zsh/custom/completions/_containerlab
Completion script location
echo $fpath
will show the directories zsh reads files from. You can either use one of the available completions directories from this list or add a new directory to the list by adding this in your .zshrc file:
And then using ~/.oh-my-zsh/custom/completions
for your completions.
Start a new shell for this setup to take effect.
Fish completions#
To load completions for each session, execute once: