On Mon, May 8, 2017 at 12:12 PM Fabian Homborg <fhomb...@gmail.com> wrote:
> Regarding unit tests, we've skipped doing those for completions since the
> interesting ones all rely on the tool being available, and we can't have it
> so the fish tests only succeed on a system that has all that stuff (which I
> don't think is even possible since we have some completions for linux-only
> tools and others for macOS-only ones).
>
Just to make sure I have it right, there's no way to test them, as one
hasn't been built because they can't all be tested on one system? Seems
like the test framework ought to have a way to say "Skip this test if the
command doesn't exist", but that's beyond the scope of my question.
> Hope that help
>
Immensely. Not only did it handle the issue I asked about, but one I forgot
to ask about as well. The outstanding issue I've looked at but can't figure
out is suppressing completion against files. For instance:
zfs mount [ -a | filesystems ....]
which completes against zfs file systems if there's no -a, but is complete
if there is one. I have:
complete -c zfs -n __fish_zfs_needs_command -a mount -f -d 'Mount zfs file
systems'
complete -c zfs -n '__fish_zfs_command mount; and not __fish_zfs_flag a' -f
-a '(__fish_zfs_list filesystem)'
Without the -a, things work fine. But if I type "zfs mount -a TAB", it
completes against the local file system. I had expected the -f to stop
that, but it doesn't seem to work. Can this be done?
Thanks,
Mike
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users