about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-02-18 15:53:19 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-02-18 15:53:19 +0000
commit3f588ef05f56031de452e940b0f4b4fd5453b4ed (patch)
tree9b189a6c12ca29e5319f9502233b07e20a7ed4ea /Completion
parentee5d13e7287c1cdd18422fc1444089e5e10532ee (diff)
downloadzsh-3f588ef05f56031de452e940b0f4b4fd5453b4ed.tar.gz
zsh-3f588ef05f56031de452e940b0f4b4fd5453b4ed.tar.xz
zsh-3f588ef05f56031de452e940b0f4b4fd5453b4ed.zip
merge changes from 4.1
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Linux/Command/.distfiles2
-rw-r--r--Completion/Linux/Command/_uml147
-rw-r--r--Completion/Unix/Command/_ssh4
-rw-r--r--Completion/Unix/Command/_webbrowser2
-rw-r--r--Completion/Unix/Type/_urls2
-rw-r--r--Completion/Zsh/Command/_read19
6 files changed, 171 insertions, 5 deletions
diff --git a/Completion/Linux/Command/.distfiles b/Completion/Linux/Command/.distfiles
index 20549b37e..5968b219d 100644
--- a/Completion/Linux/Command/.distfiles
+++ b/Completion/Linux/Command/.distfiles
@@ -1,4 +1,4 @@
 DISTFILES_SRC='
 .distfiles
-_losetup _modutils _mondo _valgrind
+_losetup _modutils _mondo _uml _valgrind
 '
diff --git a/Completion/Linux/Command/_uml b/Completion/Linux/Command/_uml
new file mode 100644
index 000000000..f2deb7484
--- /dev/null
+++ b/Completion/Linux/Command/_uml
@@ -0,0 +1,147 @@
+#compdef linux uml_moo uml_mconsole uml_switch tunctl
+
+local curcontext="$curcontext" state st line expl suf ret=1
+typeset -A opt_args
+
+case $service in
+  uml_moo)
+    _arguments '1:COW file:_files -g \*cow\*' '2:new backing file:_files'
+    return
+  ;;
+  uml_switch)
+    _arguments \
+      '-unix[listen on specified pair of sockets]:control socket: :data socket' \
+      '-hub[act like a hub]'
+  ;;
+  uml_mconsole)
+    if (( CURRENT == 2 )); then
+      _wanted socket expl 'socket name' compadd {~/.uml,/tmp}/*/mconsole(N=:h:t) && ret=0
+    elif [[ $words[CURRENT-1] = config ]]; then
+      if [[ -prefix ubd || -prefix eth ]]; then
+        state=option
+      else
+        _wanted device expl device compadd -S '' ubd eth && ret=0
+      fi
+    elif [[ $words[CURRENT-1] = remove ]]; then
+      _wanted device expl device compadd ubd{0..7} eth{0..9} && ret=0
+    elif (( CURRENT == 3 )); then
+      _values 'command' \
+        'version[print the UML kernel version number]' \
+	'help[print help]' \
+	'halt[shutdown UML system immediately]' \
+	'reboot[reboot the UML system immediately]' \
+	'config[add a new device to the virtual machine]' \
+	'remove[delete a device from the virtual machine]' \
+	'sysrq[perform sysrq action]:key:((r\:turn\ of\ keyboard\ raw\ mode k\:secure\ access\ key b\:reboot o\:shutdown s\:sync u\:remount p\:dump\ registers t\:dump\ tasks m\:dump\ memory e\:SIGTERM\ to\ all i\:SIGKILL\ to\ all l\:SIGKILL\ to\ all\ inc.\ init h\:help {0..9}\:console\ log\ level))' \
+	'cad[invoke ctrl-alt-del handler]' \
+	'stop[pause the UML]' \
+	'go[continue the UML]' \
+	&& ret=0
+    else
+      _message 'no more arguments'
+    fi 
+  ;;
+  linux)
+    _arguments -C \
+      '(* -)--version[display kernel version number]' \
+      '(* -)--help[print usage information]' \
+      '(* -)--showconfig[show kernel configuration]' \
+      '(-)*:option:->option' && return
+  ;;
+  tunctl)
+    _arguments \
+      '(-d)-b[brief output]' \
+      '-f[specify tun clone device]:tun clone device:_files' \
+      '(-d)-u[specify owner]:owner:_users' \
+      '(-b -u -t)-d[specify devicename to delete]:device name:(tap{0..9})' \
+      '(-d)-t[specify devicename]:device name:(tap{0..9})'
+  ;;
+esac
+
+while [[ -n $state ]]; do
+  st=$state
+  unset state
+  case $st in
+    option)
+      if compset -P '(ssl|con)[0-9]#='; then
+        state=channel
+	continue
+      elif compset -P con; then
+	_message 'console number'
+	return
+      elif compset -P ssl; then
+	_message 'serial line number'
+	return
+      elif compset -P 'ubd[0-7](|r)(|s)='; then
+        compset -P '*,'
+        _files && return
+      elif compset -P ubd; then
+        _message 'device number'
+	return
+      elif compset -P 'eth[0-9]##='; then
+        if compset -P 1 '*,'; then
+	  _message option
+	else
+	  _wanted transports expl transports compadd -S, \
+	    ethertap tuntap daemon mcast slip && return
+        fi
+	return
+      elif compset -P eth; then
+        _message number
+	return
+      fi
+      compadd -n -S '' con ssl ubd eth && ret=0
+      _values -C "option" \
+	'mem[specify amount of "physical" memory to allocate]:memory' \
+	'iomem[configure file as named IO memory region]:arg:->iomem' \
+	'gdb[attach gdb to specified channel]:channel:->channel' \
+	'gdb-pid[specify pid of debugger]:debugger pid:_pids' \
+	'debugtrace[cause tracing thread to wait for debugger]' \
+	'honeypot[put process stacks in the same location as on host]' \
+	'debug[start kernel under gdb control]' \
+	'root[specify root filesystem]:root device' \
+	'umid[specify name for this UML machine]:name' \
+	'uml_dir[location to place pid and umid files]:directory:_directories' \
+	'initrd[boot from initrd image]:initrd file:_files' \
+	'jail[enable protection of kernel memory from processes]' \
+	'*con[attach a console to a host channel]:channel:->channel' \
+	'*ssl[attach a serial line to a host channel]:channel:->channel' \
+	'fake_ide[create ide0 entries which map onto ubd devices]' \
+	'*ubd[associate device with host file]' \
+	'fakehd[change the ubd device name to "hd"]' \
+	'*eth[configure a network device]' \
+	'ncpus[specify number of virtual processors to start]:processors' \
+	'mode[force UML to run in specified mode]:mode:(tt)' \
+	'mconsole[request mconsole driver to send a message to socket]:socket' \
+	'xterm[specify alternate terminal emulator]:terminam emulator:->xterm' \
+	'dsp[specify host dsp device]:dsp device:_files' \
+	'mixer[specify host mixer device]:mixer device:_files' \
+	'umn[specify ip address for host side of slip device]' && ret=0
+    ;;
+    iomem)
+      if compset -P '*,'; then
+	_files && ret=0
+      else
+	_message name
+      fi
+    ;;
+    channel)
+      compset -P '*,' || suf=( -S , )
+      _values -S : ${suf/S/s} "channel" \
+	pty pts xterm \
+	'tty:tty:_files $suf' \
+	"fd:file descriptor:_file_descriptors $suf" && ret=0
+    ;;
+    xterm)
+      if compset -P 2 '*,'; then
+        _wanted -x argument expl 'execute switch' compadd - -e -x && ret=0
+      elif compset -P 1 '*,'; then
+        _wanted -x argument expl 'title switch' compadd -S , - -t -T -title && ret=0
+      else
+        _wanted command expl 'terminal emulator' _command_names -e -S , && ret=0
+      fi
+    ;;
+  esac
+done
+
+return ret
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 4c2eef7cc..40f495ea9 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -17,9 +17,9 @@ _remote_files () {
     while _tags; do
       while _next_label files expl ${suf:-remote directory}; do
         [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \
-	    ${remdispf%[*=@|]} && ret=0 
+	    ${(q)remdispf%[*=@|]} && ret=0 
 	compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
-	    ${remdispd%/} && ret=0
+	    ${(q)remdispd%/} && ret=0
       done
       (( ret )) || return 0
     done
diff --git a/Completion/Unix/Command/_webbrowser b/Completion/Unix/Command/_webbrowser
index bde1372be..4e3df2a54 100644
--- a/Completion/Unix/Command/_webbrowser
+++ b/Completion/Unix/Command/_webbrowser
@@ -1,3 +1,3 @@
-#compdef amaya arena chimera express grail gzilla hotjava mmm opera www xmosaic Mosaic galeon konqueror skipstone light dillo
+#compdef amaya arena chimera dillo express galeon grail gzilla hotjava konqueror light mmm Mosaic netrik opera phoenix retawq skipstone www xmosaic zen
 
 _urls -f
diff --git a/Completion/Unix/Type/_urls b/Completion/Unix/Type/_urls
index da9c368e6..4eeff5c99 100644
--- a/Completion/Unix/Type/_urls
+++ b/Completion/Unix/Type/_urls
@@ -57,7 +57,7 @@ zstyle -a ":completion:${curcontext}:urls" urls urls
 
 if [[ $#urls -gt 1 || ( $#urls -eq 1 && ! -d $urls[1] ) ]]; then
   [[ $#urls -eq 1 && -f $urls[1] ]] && urls=( $(< $urls[1]) )
-  _wanted urls expl 'urls' compadd -a urls && return 0
+  _wanted urls expl 'url' compadd -a urls && return 0
   urls=()
 fi
 
diff --git a/Completion/Zsh/Command/_read b/Completion/Zsh/Command/_read
new file mode 100644
index 000000000..e398eaf1e
--- /dev/null
+++ b/Completion/Zsh/Command/_read
@@ -0,0 +1,19 @@
+#compdef read
+
+local pflag expl line curcontext="$curcontext"
+
+# -p flag only relevant if we have a coprocess
+(:>&p) 2>/dev/null &&
+  pflag='(-q -u -z)-p[input is read from the coprocess]'
+
+_arguments -C -s -A "-*" -S \
+  '-r[raw mode]' \
+  '(-p -k -u -z)-q[read y or n character from terminal]' \
+  '(-q)-k[specify number of characters to read]:number of characters' \
+  '(-q -z)-t[test if input is available before reading]' \
+  '(-q -u -p)-z[read entry from editor buffer stack]' \
+  '(-E)-e[input read is echoed and not assigned]' \
+  '(-e)-E[input read is echoed]' \
+  '-A[first name is taken as an array]' \
+  '(-q -z -p)-u+[specify file-descriptor to read from]:file-descriptor:_file_descriptors' \
+  $pflag '1:varprompt:_vars -qS\?' '*:vars:_vars'