This patch will complete *.rrd files after first command.
Christophe
--- rrdtool 2010-07-01 10:14:08.700956317 +0200
+++ /etc/bash_completion.d/rrdtool 2010-07-01 09:49:11.864967102 +0200
@@ -6,10 +6,15 @@ _rrdtool ()
local cur
_get_comp_words_by_ref cur
- COMPREPLY=( $( compgen -W 'create update updatev graph dump restore last \
- lastupdate first info fetch tune resize xport' -- "$cur" ) )
+ if [ $COMP_CWORD -eq 1 ]; then
+ COMPREPLY=( $( compgen -W 'create update updatev graph dump restore last \
+ lastupdate first info fetch tune resize xport' -- "$cur" ) )
+ else
+ _filedir 'rrd'
+ return 0
+ fi
} &&
-complete -F _rrdtool rrdtool
+complete -F _rrdtool -o filenames rrdtool
# Local variables:
# mode: shell-script