gdb: support --args style completion (Alioth: #314664)

This commit is contained in:
Peter Wu 2014-04-22 16:59:31 +02:00 committed by Ville Skyttä
parent 13ad1f1966
commit b1f7803556

View File

@ -2,9 +2,18 @@
_gdb() _gdb()
{ {
local cur prev words cword local cur prev words cword i
_init_completion || return _init_completion || return
# gdb [options] --args executable-file [inferior-arguments ...]
for (( i=1; i < cword; i++ )); do
if [[ "${words[i]}" == --args ]]; then
_command_offset $((i+1))
return $?
fi
done
# gdb [options] [executable-file [core-file or process-id]]
if [[ $cword -eq 1 ]]; then if [[ $cword -eq 1 ]]; then
local IFS local IFS
compopt -o filenames compopt -o filenames