Dont complete unknown args
This commit is contained in:
parent
59a95221c8
commit
001a047f36
@ -9,7 +9,7 @@ __worldname_list() {
|
||||
}
|
||||
|
||||
_luanti() {
|
||||
local cur prev opts file_opts color_values worldlist_values
|
||||
local cur prev opts file_opts unknown_val_opts color_values worldlist_values
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
@ -17,6 +17,7 @@ _luanti() {
|
||||
|
||||
opts="--address --color --config --console --debugger --gameid --go --help --info --logfile --map-dir --migrate --migrate-auth --migrate-mod-storage --migrate-players --name --password --password-file --port --quiet --random-input --recompress --run-benchmarks --run-unittests --server --terminal --test-module --trace --verbose --version --world --worldlist --worldname"
|
||||
file_opts="--config --logfile --map-dir --password-file --world"
|
||||
unknown_val_opts="--address --migrate --migrate-auth --migrate-mod-storage --migrate-players --name --password --port --test-module"
|
||||
color_values="always auto never"
|
||||
worldlist_values="both name path"
|
||||
|
||||
@ -32,6 +33,8 @@ _luanti() {
|
||||
COMPREPLY=($(compgen -W "$(__worldname_list)" -- "$cur"))
|
||||
elif [[ " ${file_opts[*]} " == *" ${prev} "* ]]; then
|
||||
_comp_compgen_filedir
|
||||
elif [[ " ${unknown_val_opts[*]} " == *" ${prev} "* ]]; then
|
||||
:
|
||||
else
|
||||
COMPREPLY=($(compgen -W "$opts" -- "$cur"))
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user