Skip to content

Commit

Permalink
gdb: support --args style completion (Alioth: #314664)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekensteyn authored and scop committed Apr 23, 2014
1 parent 13ad1f1 commit b1f7803
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion completions/gdb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

_gdb()
{
local cur prev words cword
local cur prev words cword i
_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
local IFS
compopt -o filenames
Expand Down

0 comments on commit b1f7803

Please sign in to comment.