From 3f95440f26df47836f047c20dca12be90e54d6de Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 20 Apr 2020 19:01:36 +0200 Subject: [PATCH] completions: Use commandline -opc, not just -o `commandline -o` tokenizes *the entire commandline buffer*. See #6922. --- share/completions/npm.fish | 2 +- share/completions/phpunit.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/completions/npm.fish b/share/completions/npm.fish index 601f9c5b2..e9ec20990 100644 --- a/share/completions/npm.fish +++ b/share/completions/npm.fish @@ -50,7 +50,7 @@ function __fish_complete_npm -d "Complete the commandline using npm's 'completio if command -sq npm # npm completion is bash-centric, so we need to translate fish's "commandline" stuff to bash's $COMP_* stuff # COMP_LINE is an array with the words in the commandline - set -lx COMP_LINE (commandline -o) + set -lx COMP_LINE (commandline -opc) # COMP_CWORD is the index of the current word in COMP_LINE # bash starts arrays with 0, so subtract 1 set -lx COMP_CWORD (math (count $COMP_LINE) - 1) diff --git a/share/completions/phpunit.fish b/share/completions/phpunit.fish index 8cb18caaf..56c51c86d 100644 --- a/share/completions/phpunit.fish +++ b/share/completions/phpunit.fish @@ -11,7 +11,7 @@ end # Lists PHPUnit objects corresponding to the given option function __fish_phpunit_list --argument option # Use the same PHPUnit binary as in the command being completed - set -l phpunit (commandline -o)[1] + set -l phpunit (commandline -opc)[1] test -x $phpunit or return