fish-shell/tests/checks
Johannes Altmanninger eae1683033 Completion: complete argument to last of a group of short options
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
2019-10-16 11:30:50 +02:00
..
broken-config/fish Port config tests to littlecheck 2019-06-25 22:31:06 +02:00
abbr.fish Unexpand abbreviations' variable names before completing them 2019-10-06 14:42:42 +02:00
alias.fish Port alias test to littlecheck 2019-06-26 21:19:40 +02:00
andandoror.fish Correctly implement and --help and or --help 2019-09-08 10:42:24 -07:00
argparse.fish builtins: Use standard builtin.h error macros more 2019-09-17 22:04:33 -07:00
bad-option.fish Add NetBSD's error to the bad-option test 2019-07-02 23:48:25 +02:00
bind.fish Port bind tests to littlecheck 2019-06-26 21:19:40 +02:00
broken-config.fish Port config tests to littlecheck 2019-06-25 22:31:06 +02:00
command-1.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
command-2.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
command-vars-persist.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
complete.fish Completion: complete argument to last of a group of short options 2019-10-16 11:30:50 +02:00
count.fish Port count test to littlecheck 2019-06-26 21:19:40 +02:00
directory-redirect.fish tests: Simplify directory-redirect test 2019-06-28 20:48:11 +02:00
env.fish Correctly mark a node when erasing an exported variable 2019-06-28 11:22:49 -07:00
eval.fish eval tests: Fix path 2019-07-03 15:14:49 +02:00
expansion.fish Fix caret position of invalid expansion in command position 2019-10-06 13:43:05 -07:00
features-nocaret1.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
features-nocaret2.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
features-nocaret3.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
features-nocaret4.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
features-qmark1.fish Port qmark1 test to littlecheck 2019-06-25 22:31:06 +02:00
features-qmark2.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
features-string-backslashes-off.fish tests, CHANGELOG: regex-easyesc 2019-08-13 22:56:31 -07:00
features-string-backslashes.fish tests, CHANGELOG: regex-easyesc 2019-08-13 22:56:31 -07:00
function.fish Fix options after --argument-names to function (#6188) 2019-10-10 18:09:26 +02:00
init-command-2.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
init-command-mix-ordering.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
init-command-mix.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
init-command.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
interactive.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
invocation.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
login-interactive.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
login.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
math.fish builtins: Use standard builtin.h error macros more 2019-09-17 22:04:33 -07:00
no-login-no-interactive.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
printf.fish Port printf tests to littlecheck and teach the tester how to run it 2019-06-16 14:10:41 -07:00
rc-returned.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
realpath.fish Port realpath tests to littlecheck 2019-07-02 23:05:50 +02:00
set.fish Export all local exported variables in a new scope 2019-10-06 12:10:21 -07:00
setenv.fish Port setenv tests to littlecheck 2019-07-09 10:02:50 -07:00
sigint.fish Add a simple test for SIGINT out of loops 2019-10-15 22:33:53 -07:00
signal.fish Port signal tests to littlecheck 2019-06-26 11:07:46 -07:00
string.fish builtins: Use standard builtin.h error macros more 2019-09-17 22:04:33 -07:00
switch.fish Allow switch with something that expands to nothing 2019-07-31 14:08:28 +02:00
version.fish Port most of the invocation tests to littlecheck 2019-06-25 20:56:29 +02:00
wraps.fish Raise the recursion limit of complete 2019-10-03 21:25:19 +02:00