You are not logged in.

#1 2010-06-06 15:21:54

hanlin
Member
Registered: 2010-05-14
Posts: 21

bash completion of alias

I have the following lines in my .bashrc:

alias y='yaourt'
alias yq='y -Q'
complete -o filenames -F _yaourt y

This allows me to do bash completion with just 'y -Q' or 'y' followed by any argument. However, I'm trying to get completion to work when I type in 'yq'. I was wondering if there was a way to send the argument '-Q' to the yaourt completion? Or would I need to write a separate wrapper function?

Offline

#2 2010-06-06 15:37:21

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: bash completion of alias

well, did you try adding yq to the already existing line? "... _yaourt y yq"?

I don't know if it's possible with bash but it's certainly possible (and standard behaviour iirc) in ZSH so you might want to give zsh a shot.

Regards,
demian


no place like /home
github

Offline

#3 2010-06-06 15:47:03

hanlin
Member
Registered: 2010-05-14
Posts: 21

Re: bash completion of alias

Yes, but it doesn't work. The problem is that yaourt by itself has no tab completion. It requires arguments so that it knows what type of completion it is: ie. installed vs not installed programs. I would prefer to get it to work in bash, but if not, I'll take a look at zsh.

Offline

Board footer

Powered by FluxBB