zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: BUG: Autocompletion for umount doesn't handle spaces in mount points
Date: Tue, 22 May 2012 00:54:20 +0900	[thread overview]
Message-ID: <54CECE9A-4C87-4A62-83C1-43EA6F33FCE0@kba.biglobe.ne.jp> (raw)
In-Reply-To: <8402C893-8E99-4D12-B29B-1783BEF78107@gmail.com>

On 2012/05/18, at 16:18, David Lee wrote:
> Autocompletion for umount lists mount points clipped at the first space. For example, if I have "/Volumes/Media Drive" and "/Volumes/Media Disk", autocomplete for amount will only list a single "/Volumes/Media".

I guess you are using MacOSX, and, yes, this does happen on Mac
(and maybe on other BSD's also).

The following patch may fix the problem (MacOSX only).

The patch also includes two lines of '+  freebsd*|dragonfly*|darwin*)'
to use the same completion for mount/umount options as freebsd.

I have no time to write _fs_xxxx (and devordir) for MacOSX, but
they are necessary only if you use mount command.


Index: Completion/Unix/Command/_mount
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_mount,v
retrieving revision 1.31
diff -u -r1.31 _mount
--- Completion/Unix/Command/_mount	1 Mar 2011 20:22:00 -0000	1.31
+++ Completion/Unix/Command/_mount	21 May 2012 15:37:37 -0000
@@ -690,7 +690,7 @@
     deffs=hsfs
     typeops=-F
     ;;
-  freebsd*|dragonfly*)
+  freebsd*|dragonfly*|darwin*)
     args=( -s
       '(:)-a[mount all filesystems in fstab]'
       '-d[cause everything to be done except for the actual system call]'      
@@ -765,7 +765,7 @@
 	'*:dev or dir:->udevordir'
       )
     ;;
-    freebsd*|dragonfly*)
+    freebsd*|dragonfly*|darwin*)
       args=(
 	'(*)-a[unmount all mounted file systems]'
 	'-A[unmount all mounted file systems except the root]'
@@ -904,6 +904,11 @@
       mp_tmp+=( $mline[(w)3] )
     done
   ;;
+  darwin*)
+    tmp=( "${(@f)$(/sbin/mount)}" )
+    dev_tmp=( "${(@)${(@)tmp%% *}:#map}" )
+    mp_tmp=( "${(@)${(@)tmp#* on }%% \(*}" )
+    ;;
   *)
     /sbin/mount | while read mline; do
       mp_tmp+=( $mline[(w)1] )

      parent reply	other threads:[~2012-05-21 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18  7:18 David Lee
2012-05-19 18:16 ` Peter Stephenson
2012-05-21 15:54 ` Jun T. [this message]

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=54CECE9A-4C87-4A62-83C1-43EA6F33FCE0@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /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).