Commit Graph

16 Commits

Author SHA1 Message Date
Johannes Altmanninger
29f35d6cdf completion: adopt commandline -x replacing deprecated -o
This gives us more accurate completions because completion scripts get
expanded paths
2024-01-27 09:28:06 +01:00
Johannes Altmanninger
47b0d0c293 Make __fish_is_nth_token and __fish_nth_token private again
Their names are not perfect, so let's keep them as internal functions,
until we figure out how/if we want to expose this.

This reverts 0445126c2 (Undunder __fish_is_nth_token, 2021-06-29) (but I
did it without "git revert").

Closes #8008
2022-02-13 10:45:38 +01:00
Mahmoud Al-Qudsi
b3142a29e7 Fix zfs add completions 2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
5b7dd5e806 Fix zpool attach completions
The previous behavior vs the current (hopefully ideal) behavior:

* zpool attach [lists pools and devices - should list only pools]
* zpool attach tank [lists pools and devices - should list only devices already
    part of pool "tank"]
* zpool attach tank da1 [lists pools and devices - should list only devices not
    already part of pool "tank" or any pool, depending on -f flag to attach]
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
8d386a27f3 zfs completions: Factor out OpenZFS features and support
As of FreeBSD 13 (released April 2021), FreeBSD has rebased its zfs support on
top of the OpenZFS distribution previously used only/chiefly by Linux;
accordingly, it has gained support for some previously Linux-only completions.
This patch changes some completions previously predicated on a Linux ZFS
installation to the presence of an OpenZFS installation. Note that there
continue to be (and probably always will be) separate Linux-only and
FreeBSD-only completions (and not just when it comes to interacting with the
device subsystem, etc).
2022-02-08 14:17:00 -06:00
Mahmoud Al-Qudsi
c560240abc [zpool] Improve ZFS completions
Do not show devices already part of a zpool on calls to `zpool add`
and the converse.
2020-10-25 21:51:34 -05:00
Fabian Homborg
495cbb185f completions/zpool: Use --inherit-variable
The local-exported variable will have disappeared by the time the
function is called.

"-V"/"--inherit-variable" is meant for something like this.

Fixes #7011
2020-05-16 23:02:47 +02:00
Johannes Altmanninger
49c5f96470 Use set -l to force use of a local variable
Bare set overwrites a global/universal variable if it exists.
2020-05-15 08:25:07 +02:00
Fabian Homborg
9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00
Jason Nader
f507f4ad1e Ddon't use gettext fn in fish functions 2020-02-28 11:29:54 +01:00
Jason
3cf6ebc0e1 Amend typos and grammar errors 2019-11-25 13:07:15 +01:00
Fabian Homborg
ce245704d7 Reformat completion scripts
These were excluded from style.fish
2019-05-05 12:53:09 +02:00
Mahmoud Al-Qudsi
93b02dcec4 Don't use camcontrol in FreeBSD zpool completions
It requires root/su privileges to list devices, and we have a great
alternative that already produces the desired results.
2019-03-29 17:43:03 -05:00
Fabian Homborg
fc7d11d7b8 Update zpool completions to use string instead of grep 2019-03-29 17:37:26 -05:00
Fabian Homborg
aa08504fe3 completions/zpool: Stringify a bit
These are the simple bits - replace useless helper functions and uses
of grep/sed with string or other appropriate tools.
2019-03-14 13:23:47 +01:00
David Guyot
dcf9ce6fc5 Added completions/translations for zfs and zpool 2017-12-21 16:39:06 +01:00