summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 11:51:19 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 11:51:19 +0000
commit1c372cee7163c2a8d10d393406c465a2fb124c21 (patch)
tree5c4ea3f0cf1ee187623d18623bb13350a2ea2172 /Completion
parent353b710fc5dbb75e0151ee1af16e28d8441a912b (diff)
downloadzsh-1c372cee7163c2a8d10d393406c465a2fb124c21.tar.gz
zsh-1c372cee7163c2a8d10d393406c465a2fb124c21.tar.xz
zsh-1c372cee7163c2a8d10d393406c465a2fb124c21.zip
moved from Completion/User/_gdb
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_gdb55
1 files changed, 55 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_gdb b/Completion/Unix/Command/_gdb
new file mode 100644
index 000000000..f7dbb0a10
--- /dev/null
+++ b/Completion/Unix/Command/_gdb
@@ -0,0 +1,55 @@
+#compdef gdb
+
+local cur="$words[CURRENT]" prev w list ret=1 expl
+
+[[ "$PREFIX" = --* ]] &&
+    _arguments -- '*=(CORE|SYM)FILE:core file:_files' \
+		  '*=EXECFILE:executable:_files -g \*\(-\*\)' \
+		  '*=TTY:terminal device:compadd /dev/tty\*' && return 0
+
+if compset -P '-(cd|directory)='; then
+  _files -/
+elif compset -P '-tty='; then
+  _wanted devices expl 'terminal device' compadd - /dev/tty*
+elif compset -P '-(exec|se)='; then
+  _description files expl executable
+  _files "$expl[@]" -g '*(-*)'
+elif compset -P '-(symbols|core|command)='; then
+  _files
+elif [[ "$PREFIX" = -* ]]; then
+  _tags options
+  while _tags; do
+    while _next_label options expl option; do
+      compadd "$expl[@]" -QS '' - -symbols\= -exec\= -se\= -core\= -command\= \
+                                  -directory\= -cd\= -tty\= && ret=0
+      compadd "$expl[@]"        - -help -h -s -e -c -x -d -nx -n -quiet -q \
+	    		          -batch -fullname -f -b && ret=0
+    done
+    (( ret )) || return 0
+  done
+else
+  prev="$words[CURRENT-1]"
+
+  case "$prev" in
+  (-d)     _files -/ && return 0 ;;
+  (-[csx]) _files && return 0 ;;
+  (-e)     _description files expl executable
+           _files "$expl[@]" -g '*(-*)' && return 0 ;;
+  (-b)     _wanted -V values expl 'baud rate' \
+               compadd 0 50 75 110 134 150 200 300 600 1200 1800 2400 4800 \
+		       9600 19200 38400 57600 115200 230400 && return 0 ;;
+  esac
+
+  w=( "${(@)words[2,-1]}" )
+  while [[ "$w[1]" = -* ]]; do
+    [[ "$w[1]" = -[decsxb] ]] && shift 1 w
+    shift 1 w
+  done
+
+  if [[ $#w -gt 1 ]]; then
+    _alternative 'files:: _files' "processes:: _pids -m ${w[1]:t}"
+  else
+    _description files expl executable
+    _files "$expl[@]" -g '*(-*)'
+  fi
+fi