From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25647 invoked by alias); 21 May 2012 16:43:31 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30483 Received: (qmail 1249 invoked from network); 21 May 2012 16:43:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.205.19.70 as permitted sender) X-Biglobe-Sender: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: BUG: Autocompletion for umount doesn't handle spaces in mount points From: "Jun T." In-Reply-To: <8402C893-8E99-4D12-B29B-1783BEF78107@gmail.com> Date: Tue, 22 May 2012 00:54:20 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <54CECE9A-4C87-4A62-83C1-43EA6F33FCE0@kba.biglobe.ne.jp> References: <8402C893-8E99-4D12-B29B-1783BEF78107@gmail.com> To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.1278) 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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=3Dhsfs typeops=3D-F ;; - freebsd*|dragonfly*) + freebsd*|dragonfly*|darwin*) args=3D( -s '(:)-a[mount all filesystems in fstab]' '-d[cause everything to be done except for the actual system = call]' =20 @@ -765,7 +765,7 @@ '*:dev or dir:->udevordir' ) ;; - freebsd*|dragonfly*) + freebsd*|dragonfly*|darwin*) args=3D( '(*)-a[unmount all mounted file systems]' '-A[unmount all mounted file systems except the root]' @@ -904,6 +904,11 @@ mp_tmp+=3D( $mline[(w)3] ) done ;; + darwin*) + tmp=3D( "${(@f)$(/sbin/mount)}" ) + dev_tmp=3D( "${(@)${(@)tmp%% *}:#map}" ) + mp_tmp=3D( "${(@)${(@)tmp#* on }%% \(*}" ) + ;; *) /sbin/mount | while read mline; do mp_tmp+=3D( $mline[(w)1] )=