mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Modernize bash-completion
Use _init_completion Support long options with or without = Auto generate options from the --help using _parse_help
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
#-*- mode: shell-script;-*-
|
||||
_mdb_ver()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-M -h --help' -- $cur ) )
|
||||
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
|
||||
#COMPREPLY=($(compgen -W '--help --mdbtools' -- "$cur"))
|
||||
else
|
||||
_filedir '@(mdb|mdw|accdb)'
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user