You are not logged in.
My experience with shells other than bash is very limited but I think other people might be able to help:
Let's say I'm recompiling the kernel. When finished, my pwd will have the files: kernel26-2.6.30.4-1-i686.pkg.tar.gz, kernel26.install and kernel26.preset.
Now what I want to do (because I'm VERY lazy) is type:
pacman -U k
and then press tab, and have it fill in:
pacman -U kernel26-2.6.30.4-1-i686.pkg.tar.gz
however tab completion in bash doesn't do this. It stops at kernel26 because there are multiple files starting with that string.
I know this behaviour is useful but for a command like pacman, it doesn't make sense to have a ".install" file, a ".preset" file or indeed any text file as its argument. The only file that makes sense is the tar.gz file and if bash knew this its search could be narrowed down.
Is there a way to restrict what files bash considers in tab completion based on the command you've started typing? Like a config file where you specify commands and then specify allowed extensions or mime-types? Or is there another shell that allows this? Thanks.
6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.
Offline
are you using bash completion? http://projects.archlinux.org/?p=pacman … on;hb=HEAD
I see references to pkg.tar.gz in there, for the -U operation, so it might do what you want
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
pacman -S bash-completion
. /etc/bash_completion # or relogin
Then bash will complete pacman commands in the manner you describe. pacman, like many other programs, installs a file to /etc/bash_completion.d to implement special completion for pacman.
Offline
you need to install bash-completion. pacman already provides the syntax for that.
Give what you have. To someone, it may be better than you dare to think.
Offline
Ok I downloaded bash-completion and logged in again (in fact I rebooted) and I have tried the following.
mkdir foo
cd foo
touch bar.pkg.tar.gz
touch bar.install
pacman -U bar
then I press tab but ".pkg.tar.gz" is not filled in. Am I doing something wrong? Can you guys try and see what that gives you?
6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.
Offline
don't do that. use a real package. you are just doing a file not an arhive.
Give what you have. To someone, it may be better than you dare to think.
Offline
This is working now, thanks.
Last edited by ConnorBehan (2009-08-22 10:52:11)
6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.
Offline