First you must go to the following site to install the BASH programmable auto completion setup if your distro doesn't have it by default. I don't think many do so you'll need to go to the Programmable Completion Website.
Once you've setup your system for auto completion you need to take the following:
#!/bin/bash
_sbaz_complete()
{
local cur commands
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
commands='available compact help install installed keycreate keyforget keyknown keyremember keyremoteknown keyrevoke pack remove retract setuniverse setup share show showuniverse update packages upgrade'
cur=`echo $cur | sed 's/\\\\//g'`
COMPREPLY=($(compgen -W "${commands}" ${cur} | sed 's/\\\\//g') )
}
complete -F _sbaz_complete -o filenames sbaz
And place it in /etc/bash_completion.d/sbaz. Once you've done that the next time you start up your BASH shell you will have sbaz auto completion!
Download snippet code here.
0 comments:
Post a Comment