Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does zsh completion work for VBoxManage but not vboxmanage?

I have zsh-completions installed on arch linux. Completion of VBoxManage command seems to work fine, but vboxmanage doesn't (ie. just does simple completion of files int he local directory). Both VBoxManage and vboxmanage are symlinks to the VBox executable.

It seems that my _virtualbox completion definition has a first line of

#compdef VBoxManage=vboxmanage VBoxHeadless=vboxheadless

which looks like an alias of some sort? but it isn't working.

I have a fix which is to change the above line to

#compdef VBoxManage=vboxmanage vboxmanage=vboxmanage VBoxHeadless=vboxheadless vboxheadless=vboxheadless

This seems long-winded, there is an option to specify a pattern, but What is the correct way to alias commands like this?

like image 580
sw1nn Avatar asked Nov 10 '22 09:11

sw1nn


1 Answers

compdef _VBoxManage vboxmanage
compdef _VBoxHeadless vboxheadless

In your ~/.zshrc is the correct way to specify a completion function for a command. It is not recommended to edit the actual function in source, for obvious reasons.

like image 50
PythonNut Avatar answered Dec 20 '22 05:12

PythonNut