From b1f78035565dcca343841cc4fa7ff54b09cc81b9 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 22 Apr 2014 16:59:31 +0200 Subject: [PATCH] gdb: support --args style completion (Alioth: #314664) --- completions/gdb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/completions/gdb b/completions/gdb index 125d0b15..c3856fff 100644 --- a/completions/gdb +++ b/completions/gdb @@ -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