mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +00:00
eae1683033
Consider a group of short options, like -xzPARAM, where x and z are options and z takes an argument. This commit enables completion of the argument to the last option (z), both within the same token (-xzP) or in the next one (-xz P). complete -C'-xz' will complete only parameters to z. complete -C'-xz ' will complete only parameters to z if z requires a parameter otherwise, it will also complete non-option parameters To do so this implements a heuristic to differentiate such strings from single long options. To detect whether our token contains some short options, we only require the first character after the dash (here x) to be an option. Previously, all characters had to be short options. The last option in our example is z. Everything after the last option is assumed to be a parameter to the last option. Assume there is also a single long option -x-foo, then complete -C'-x' will suggest both -x-foo and -xy. However, when the single option x requires an argument, this will not suggest -x-foo. However, I assume this will almost never happen in practise since completions very rarely mix short and single long options. Fixes #332 |
||
---|---|---|
.. | ||
broken-config/fish | ||
abbr.fish | ||
alias.fish | ||
andandoror.fish | ||
argparse.fish | ||
bad-option.fish | ||
bind.fish | ||
broken-config.fish | ||
command-1.fish | ||
command-2.fish | ||
command-vars-persist.fish | ||
complete.fish | ||
count.fish | ||
directory-redirect.fish | ||
env.fish | ||
eval.fish | ||
expansion.fish | ||
features-nocaret1.fish | ||
features-nocaret2.fish | ||
features-nocaret3.fish | ||
features-nocaret4.fish | ||
features-qmark1.fish | ||
features-qmark2.fish | ||
features-string-backslashes-off.fish | ||
features-string-backslashes.fish | ||
function.fish | ||
init-command-2.fish | ||
init-command-mix-ordering.fish | ||
init-command-mix.fish | ||
init-command.fish | ||
interactive.fish | ||
invocation.fish | ||
login-interactive.fish | ||
login.fish | ||
math.fish | ||
no-login-no-interactive.fish | ||
printf.fish | ||
rc-returned.fish | ||
realpath.fish | ||
set.fish | ||
setenv.fish | ||
sigint.fish | ||
signal.fish | ||
string.fish | ||
switch.fish | ||
version.fish | ||
wraps.fish |