summaryrefslogtreecommitdiff
path: root/completions/rrdtool
diff options
context:
space:
mode:
Diffstat (limited to 'completions/rrdtool')
-rw-r--r--completions/rrdtool21
1 files changed, 9 insertions, 12 deletions
diff --git a/completions/rrdtool b/completions/rrdtool
index 0b15a23f..9280d8f5 100644
--- a/completions/rrdtool
+++ b/completions/rrdtool
@@ -1,20 +1,17 @@
-# bash completion for rrdtool
+# bash completion for rrdtool -*- shell-script -*-
-have rrdtool &&
_rrdtool ()
{
- local cur
- _get_comp_words_by_ref cur
+ local cur prev words cword
+ _init_completion || return
- COMPREPLY=( $( compgen -W 'create update updatev graph dump restore last \
- lastupdate first info fetch tune resize xport' -- "$cur" ) )
+ if [ ${#words[@]} -eq 2 ]; then
+ COMPREPLY=( $( compgen -W 'create update updatev graph dump restore \
+ last lastupdate first info fetch tune resize xport' -- "$cur" ) )
+ else
+ _filedir rrd
+ fi
} &&
complete -F _rrdtool rrdtool
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
# ex: ts=4 sw=4 et filetype=sh