Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: umount completion context and tags

On Sun, Dec 14, 2014 at 2:15 PM, Silas Silva <silasdb@xxxxxxxxx> wrote:
> Hi there!
> I was trying to tweak umount completion by using the tag-order style.
> AFAIK, umount completion.  According to "umount ^Xh", we have:
>     tags in context :completion::complete:umount::
>         argument-rest options  (_arguments _mount (eval))
>     tags in context :completion::complete:umount:argument-rest:
>         device-labels device-paths directories  (_alternative _mount (eval))
>         device-paths                            (_canonical_paths _canonical_paths _alternative _mount (eval))
> It means that we have at least three tags:
>     device-labels
>     device-paths
>     directories
> device-labels is useless for me, so I tried to exclude it:
>     zstyle ':completion:*:mount:*' tag-order '!device-labels'
> But, it simply doesn't work!  ^Xh still gives me all tags.  Taking a
> glance at the _mount completion, it has tags above hardcoded, but I
> didn't look further.
> In reality, what I want is to avoid behaviour like (in Linux):
>     mount /dev/sdb1 /mnt/usb0
>     cd /mnt
>     umount u<Tab>
>     umount udev  (!!!)
> Any help?
> Thank you!

That's weird in at least two ways. I get the style to work only if i
make it ":completion:*". Secondly, those are filesystem types, not
labels, and are only valid after -t afaik(?), and umount -t produces a
broken completion.

Mikael Magnusson

Messages sorted by: Reverse Date, Date, Thread, Author