You are not logged in.

#1 2005-08-03 05:53:50

windrider
Member
Registered: 2005-05-07
Posts: 27

n00b question about bashrc completion

lets say i wanna auto complete with .torrent files when i type btdl (tab), i put this in my bashrc file

complete -f -o default -X '!*.+(torrent|TORRENT)' btdownloadcurses.py btdl

however i want to do more than this. i want the listed candidates to be sorted by date. So for example when i have 14 torrent files in my current directory, when i enter

btdl (tab)

i want the files displayed by pressing to be displayed in order of date of modification of the file.

can anyone kindly teach me how to do this.

i suspect its just an additional -something option in the above line?

Offline

#2 2005-08-03 07:30:54

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: n00b question about bashrc completion

Hmmm.. I wasn't aware bash could do such magic with its completion... must investigate further...

Thanks for bringing this up on the forums.

Offline

#3 2005-08-03 15:44:34

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: n00b question about bashrc completion

IceRAM wrote:

Hmmm.. I wasn't aware bash could do such magic with its completion... must investigate further...

Thanks for bringing this up on the forums.

Yeah it's part of the bash_completion package... I don't know the syntax myself... but there's a million examples in /etc

Offline

#4 2005-08-04 03:32:59

windrider
Member
Registered: 2005-05-07
Posts: 27

Re: n00b question about bashrc completion

i couldnt get bash-completion package to work, i'm using the default .bashrc in my user dir for this.

Offline

Board footer

Powered by FluxBB