- From: Avishai Ish-Shalom <
>
- To:
- Subject: [chef] Re: Re: Knife bash completion - improved
- Date: Thu, 20 Jan 2011 16:40:46 +0200
- Organization: FewBytes Technologies
Well, my wife has a mac. I'll try to arm wrestle her for some quality
time with it later today.
Regards,
Avishai
On 01/20/2011 04:36 PM, Jacob Vanderdray wrote:
>
This sounded helpful enough that I gave it a shot. I'm using a Mac,
>
so I ran into a few issues. Unfortunately I still don't have it working
>
past the first knife parameter (i.e. if I type "knife cook" and hit <tab> I
>
end up with "knife cookbook", but when I type "knife cookbook upl" and hit
>
tab I get an error. I'm going to give up for now, but if you're interested
>
here's what I had to do (This is mostly from memory so YMMV):
>
>
Use Macports to install bash-completion:
>
sudo port install bash-completion
>
>
Update ~/.bash_profile with:
>
>
# MacPorts Bash shell command completion
>
if [ -f /opt/local/etc/bash_completion ]; then
>
. /opt/local/etc/bash_completion
>
fi
>
>
The version of sed used in this script uses "-r" to get extended regular
>
expressions, but for the version of sed on my Mac I had to change that to
>
"-E". If someone works out the rest, I'd be interested.
>
>
Thanks,
>
Jake.
>
>
On Jan 20, 2011, at 4:06 AM, Avishai Ish-Shalom wrote:
>
>
> OK. Now it works fast, used cache files for command completions and
>
> while i was at it i added roles and nodes completion.
>
>
>
> Cache files reside in $CHEF_HOME/.completion_cache and you have to
>
> create this directory if you want cached completion.
>
>
>
>
>
> And yes, now it will read chef repository locations from either
>
> CHEF_REPOS or $CHEF_HOME/knife.rb
>
>
>
>
>
> enjoy.
>
>
>
> Avishai
>
>
>
> <knife.txt>
Archive powered by MHonArc 2.6.16.