the `todo.sh` script allows redefining commands locally, which can mess
up this completion script. We are using the `command` subcommand to
avoid that.
This is done by simply adding a missing backslash to the code.
Fixes: 85bf9740a0 ("49668: update zfs completion")
Signed-off-by: Christian Heusel <christian@heusel.eu>
fusermount3 is part of libfuse version 3, while fusermount is part of
libfuse version 2. Since they share the exact same command line
interface, we can reuse the completions.
Via 842587016d in the git project there has been support for git commit
trailer tokens for the bash completion system. This commit adds similar
support to zsh. It includes additional hardening of the regexp and
allows for tokens which include a '.'. This can be found in git via
9a0ec17606.
_parameters is used in many contexts, like assignments in command
position, assignment after typeset, etc, where history modifiers are not
valid. _brace_parameter already calls _history_modifiers explicitly so
this seems more in line with that.
This solves the following problems in the _prefix completer:
- The old code had logic for dealing with compstate[unambiguous] that
was unnecessary. It works fine without it.
- Because of this logic, if a widget set compstate[insert]=1 after
calling _main_complete, an `x` was left after the completion on the
command line.
- If the same widget also set `compstate[to_end]=`, then instead, the
last character of the inserted completion would be treated as an
autoremovable suffix, with the actual suffix being inserted to the
line as a normal character.
- After inserting a completion, the cursor would move to the end of the
entire current word on the command, not the end of word that was
inserted. This is not what you want with _prefix, since you are trying
to complete a word _before_ the one on the command line, after which
you usually want to insert a separator, such as a space or slash,
before the next word.
When completing inside ~[...] (_with_ the trailing `]` present), the
following bugs occured:
- Subscript completion was skipped entirely when there were one or more
slashes ('/') in the subscript, which is incorrect, since slashes are
allowed there.
- Instead of going through _complete, $_comps[-subscript-] was called
immediately, causing _setup to be skipped.
- If succesful, _main_complete was exited right after, causing
menu-style, comppostfuncs and other essential completion features to
be skipped.