mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 17:31:14 -03:00
completion: adopt commandline -x replacing deprecated -o
This gives us more accurate completions because completion scripts get expanded paths
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
function __fish_nth_token --description 'Prints the Nth token (ignoring command and switches/flags)' --argument-names n
|
||||
set -l tokens (commandline -po | string replace -r --filter '^([^-].*)' '$1')
|
||||
set -l tokens (commandline -px | string replace -r --filter '^([^-].*)' '$1')
|
||||
# Increment $n by one to account for ignoring the command
|
||||
if test (count $tokens) -ge (math "$n" + 1)
|
||||
echo $tokens[(math $n + 1)]
|
||||
|
||||
Reference in New Issue
Block a user