diff --git a/share/completions/and.fish b/share/completions/and.fish index 50d2825b6..9c9efde12 100644 --- a/share/completions/and.fish +++ b/share/completions/and.fish @@ -1,3 +1,2 @@ complete -c and -s h -l help -d 'Display help and exit' -complete -c and -xa '(__fish_complete_subcommand --allow-functions-and-builtins)' - +complete -c and -xa '(__fish_complete_subcommand)' diff --git a/share/completions/begin.fish b/share/completions/begin.fish index 4d3c1256f..e95aa4bbc 100644 --- a/share/completions/begin.fish +++ b/share/completions/begin.fish @@ -1,2 +1,2 @@ complete -c begin -s h -l help -d 'Display help and exit' -complete -c begin -xa '(__fish_complete_subcommand --allow-functions-and-builtins)' +complete -c begin -xa '(__fish_complete_subcommand)' diff --git a/share/completions/if.fish b/share/completions/if.fish index 5a2c2bdd4..978b1868d 100644 --- a/share/completions/if.fish +++ b/share/completions/if.fish @@ -1,2 +1,2 @@ complete -c if -s h -l help -d 'Display help and exit' -complete -c if -xa '(__fish_complete_subcommand --allow-functions-and-builtins)' +complete -c if -xa '(__fish_complete_subcommand)' diff --git a/share/completions/not.fish b/share/completions/not.fish index f77344e86..90fa69045 100644 --- a/share/completions/not.fish +++ b/share/completions/not.fish @@ -1,2 +1,2 @@ complete -c not -s h -l help -d 'Display help and exit' -complete -c not -xa '(__fish_complete_subcommand --allow-functions-and-builtins)' +complete -c not -xa '(__fish_complete_subcommand)' diff --git a/share/completions/or.fish b/share/completions/or.fish index 2c081c22d..d95e0957d 100644 --- a/share/completions/or.fish +++ b/share/completions/or.fish @@ -1,3 +1,3 @@ complete -c or -s h -l help -d 'Display help and exit' -complete -c or -xa '(__fish_complete_subcommand --allow-functions-and-builtins)' +complete -c or -xa '(__fish_complete_subcommand)' diff --git a/share/completions/while.fish b/share/completions/while.fish index d799cf9ec..d85e72092 100644 --- a/share/completions/while.fish +++ b/share/completions/while.fish @@ -1,2 +1,2 @@ complete -c while -s h -l help -d 'Display help and exit' -complete -c while -xa '(__fish_complete_subcommand --allow-functions-and-builtins)' +complete -c while -xa '(__fish_complete_subcommand)' diff --git a/share/functions/__fish_complete_external_command.fish b/share/functions/__fish_complete_external_command.fish index 6d9a25609..87f34d0bf 100644 --- a/share/functions/__fish_complete_external_command.fish +++ b/share/functions/__fish_complete_external_command.fish @@ -1,3 +1,4 @@ +# TODO: This function is deprecated, figure out a way to tell users. function __fish_complete_external_command complete -C "$argv[1]" end diff --git a/share/functions/__fish_complete_subcommand.fish b/share/functions/__fish_complete_subcommand.fish index 020a74efd..bd49f24a8 100644 --- a/share/functions/__fish_complete_subcommand.fish +++ b/share/functions/__fish_complete_subcommand.fish @@ -1,12 +1,10 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowing # Pass --commandline to complete the remainder of the arguments instead of the commandline. - # Pass --allow-functions-and-builtins to enable the completion of the first token as function or builtin. # Other args are considered flags to the supercommand that require an option. # How many non-option tokens we skip in the input commandline before completing the subcommand # Usually 1; for ssh 2. set -l skip_next 1 - set -l allow_functions_and_builtins false set -l subcommand while string match -rq -- '^--[a-z]' $argv[1] set -l arg $argv[1] @@ -14,8 +12,6 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowin switch $arg case '--fcs-skip=*' set skip_next (string split = -- $arg)[2] - case --allow-functions-and-builtins - set allow_functions_and_builtins true case --commandline set subcommand $argv set -e argv @@ -48,10 +44,5 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowin end end - if test $allow_functions_and_builtins = false && test (count $subcommand) -eq 1 - __fish_complete_external_command "$subcommand" - else - printf "%s\n" (complete -C "$subcommand") - end - + printf "%s\n" (complete -C "$subcommand") end