zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH Workers Mailing List" <zsh-workers@sunsite.dk>
Subject: PATCH: 4.1: cygwin mount
Date: Fri, 13 Jul 2001 16:10:35 +0400	[thread overview]
Message-ID: <000201c10b94$d218cab0$21c9ca95@mow.siemens.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

This is specialcased because cgwin mount has too little in common with
normal mount. I suppose, we can't currently complete 'Windows path" (that is
exactly what is expected - windows path in form x:\foo\bar\com).

Should it go into 4.0?

-andrej

[-- Attachment #2: zsh-mount-cygwin.diff --]
[-- Type: application/octet-stream, Size: 2985 bytes --]

Index: Completion/Unix/Command/_mount
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_mount,v
retrieving revision 1.4
diff -u -r1.4 _mount
--- Completion/Unix/Command/_mount	2001/06/13 11:05:51	1.4
+++ Completion/Unix/Command/_mount	2001/07/13 12:07:10
@@ -1,5 +1,49 @@
 #compdef mount umount
 
+if [[ "$OSTYPE" == cygwin ]]; then
+  if [[ "$service" == mount ]] ; then
+    _arguments -s \
+      - mount \
+        '(-b -t --text)--binary[Unix line endings LF]' \
+        '(--binary -t --text)-b[Unix line endings LF]' \
+        '(-f)--force[be silent]' \
+        '(--force)-f[be silent]' \
+        '(-s -u --user)--system[system-wide mount point]' \
+        '(--system -u --user)-s[system-wide mount point]' \
+        '(-t -b --binary)--text[(default) DOS line endings CR-LF]' \
+        '(--text -b --binary)-t[(default) DOS line endings CR-LF]' \
+        '(-u -s --system)--user[(default)user private mount point]' \
+        '(--user -s --system)-u[(default)user private mount point]' \
+        '(-x -X --cygwin-executable)--executable[all files under mountpoint are executables]' \
+        '(--executable -X --cygwin-executable)-x[all files under mountpoint are executables]' \
+        '(-X -x --executable)--cygwin-executable[all files under mountpoint are cygwin executables]' \
+        '(--cygwin-executable -x --executable)-X[all files under mountpoint are cygwin executables]' \
+        ':Windows path:' \
+        ':Unix path:_path_files -P/ -W "(/)" -/' \
+      - control \
+        '(-i -p --show-cygdrive-prefix -c --change-cygdrive-prefix)--import-old-mounts[import old mounts]' \
+        '(--import-old-mounts -p --show-cygdrive-prefix -c --change-cygdrive-prefix)-i[import old mounts]' \
+        '(-p -i --import-old-mounts -c --change-cygdrive-prefix)--show-cygdrive-prefix[show cygdrive prefix]' \
+        '(--show-cygdrive-prefix -i --import-old-mounts -c --change-cygdrive-prefix)-p[show cygdrive prefix]' \
+        '(-c -i --import-old-mounts -p --show-cygdrive-prefix)--change-cygdrive-prefix[cygdrive prefix]:cygdrive prefix (POSIX path):_files -P/ -W "(/)" -/' \
+        '(--change-cygdrive-prefix -i --import-old-mounts -p --show-cygdrive-prefix)-c[cygdrive prefix]:cygdrive prefix (POSIX path):_files -P/ -W "(/)" -/' 
+  
+    return
+  else
+    local line
+    local -a wpaths upaths
+    mount | while read -r line; do
+      [[ $line == ?:\ * ]] && continue
+      wpaths=($wpaths ${line%% on*})
+      upaths=($upaths ${${line##*on }%% type*})
+    done
+    _alternative \
+      'windowspath:WIndows path:compadd -a wpaths' \
+      'unixpath:Unix path:compadd -a upaths'
+    return
+  fi
+fi
+
 # This is table-driven: the tables for the values for the different
 # file system types are directly below. The tables describing the
 # arguments for the `mount' command for different operating systems

                 reply	other threads:[~2001-07-13 12:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000201c10b94$d218cab0$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).