mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Split bash-completion snippet in small ones
/usr/share/bash-completion/completions/ now uses dynamic loading based on file name.
This commit is contained in:
30
src/util/bash-completion/mdb-schema
Normal file
30
src/util/bash-completion/mdb-schema
Normal file
@@ -0,0 +1,30 @@
|
||||
#-*- mode: shell-script;-*-
|
||||
have mdb-schema &&
|
||||
_mdb_schema()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
if [[ "$prev" == -@(T|-table|N|-namespace) ]] ; then
|
||||
return 0
|
||||
elif [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-T --table \
|
||||
-N --namespace \
|
||||
--drop-table --no-drop-table \
|
||||
--not-null --no-not-null \
|
||||
--default-values --no-default-values \
|
||||
--not-empty --no-not-empty \
|
||||
--indexes --no-indexes \
|
||||
--relations --no-relations
|
||||
-h --help' -- $cur ) )
|
||||
elif [[ "$prev" == @(*mdb|*mdw|*accdb) ]]; then
|
||||
COMPREPLY=( $( compgen -W 'access sybase oracle postgres mysql' -- $cur ) )
|
||||
else
|
||||
_filedir '@(mdb|mdw|accdb)'
|
||||
fi
|
||||
return 0
|
||||
} &&
|
||||
complete -F _mdb_schema mdb-schema
|
||||
Reference in New Issue
Block a user