mdb-export: reorder options, man, bash-completion

This commit is contained in:
Nirgal Vourgère
2020-10-25 11:24:28 +01:00
parent 78c4f12eac
commit ea478f3bc6
3 changed files with 28 additions and 16 deletions

View File

@@ -6,16 +6,20 @@ _mdb_export()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ "$prev" == -@(d|-delimiter|R|-row-delimiter|q|-quote|X|-escape|D|-date-format|N|-namespace|h|-help) ]] ; then
if [[ "$prev" == -@(d|-delimiter|R|-row-delimiter|-quote|X|-escape|N|-namespace|S|-batch-size|D|-date-format|T|-datetime-format|0|-null|h|-help) ]] ; then
return 0
elif [[ "$prev" == -I ]] ; then
COMPREPLY=( $( compgen -W 'access sybase oracle postgres mysql' -- $cur ) )
COMPREPLY=( $( compgen -W 'access sybase oracle postgres mysql sqlite' -- $cur ) )
elif [[ "$prev" == -@(b|-bin) ]] ; then
COMPREPLY=( $( compgen -W 'strip raw octal' -- $cur ) )
COMPREPLY=( $( compgen -W 'strip raw octal hex' -- $cur ) )
elif [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-H -d -R -Q -q -X -I -D -N -b -h \
--no-header --no-quote --delimiter --row-delimiter --insert \
--date-format --quote --escape --namespace --bin --help' -- $cur ) )
COMPREPLY=( $( compgen -W '-H -d -R -Q -q -X -I -N -S -D -T -0 -B -h \
--no-header --delimiter --row-delimiter \
--no-quote --quote --escape \
--backend --namespace --batch-size \
--date-format --datetime-format \
--null --bin --boolean-words
--help' -- $cur ) )
elif [[ "$prev" == *@(mdb|mdw|accdb) ]] ; then
local dbname
local tablenames