2011-11-01 22:14:45 +02:00
|
|
|
# sqlite3(1) completion -*- shell-script -*-
|
2010-06-29 19:23:26 +03:00
|
|
|
|
|
|
|
_sqlite3()
|
|
|
|
{
|
2011-04-21 11:04:51 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2010-06-29 19:23:26 +03:00
|
|
|
|
|
|
|
local dbexts='@(sqlite?(3)|?(s?(3))db)'
|
|
|
|
|
|
|
|
case $prev in
|
|
|
|
-help|-version|-separator|-nullvalue|*.$dbexts)
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-init)
|
|
|
|
_filedir
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [[ "$cur" == -* ]]; then
|
2011-11-25 19:59:08 +02:00
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) )
|
2010-06-29 19:23:26 +03:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2014-06-05 00:42:11 +04:00
|
|
|
_filedir "$dbexts"
|
2010-06-29 19:23:26 +03:00
|
|
|
} &&
|
2010-11-01 19:26:53 +02:00
|
|
|
complete -F _sqlite3 sqlite3
|
2010-06-29 19:23:26 +03:00
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|