[Bash-completion-commits] [bash-completion] 01/01: gdb: support --args style completion (Alioth: #314664)

Ville Skyttä scop-guest at moszumanska.debian.org
Wed Apr 23 12:43:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit b1f78035565dcca343841cc4fa7ff54b09cc81b9
Author: Peter Wu <peter at lekensteyn.nl>
Date:   Tue Apr 22 16:59:31 2014 +0200

    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 125d0b1..c3856ff 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list