mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 19:41:15 -03:00
* git rm and git status options are added
* ssh subcomand completion * __fish_complete_subcommand now can skip variable number of tokens
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
function __fish_complete_subcommand -d "Complete subcommand"
|
||||
set -l skip_next 1
|
||||
switch "$argv[1]"
|
||||
case '--fcs-skip=*'
|
||||
set -l rest
|
||||
echo $argv[1] | tr = ' ' | read test skip_next
|
||||
set -e argv[1]
|
||||
end
|
||||
|
||||
set -l res ""
|
||||
set -l had_cmd 0
|
||||
set -l cmd (commandline -cop) (commandline -ct)
|
||||
set -l skip_next 1
|
||||
|
||||
for i in $cmd
|
||||
|
||||
if test "$skip_next" = 1
|
||||
set skip_next 0
|
||||
if test $skip_next -gt 0
|
||||
set skip_next (expr $skip_next - 1)
|
||||
continue
|
||||
end
|
||||
|
||||
@@ -17,15 +23,15 @@ function __fish_complete_subcommand -d "Complete subcommand"
|
||||
else
|
||||
|
||||
if contains -- $i $argv
|
||||
set skip_next 1
|
||||
set skip_next (expr $skip_next + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
switch $i
|
||||
case '-*'
|
||||
case '*=*'
|
||||
|
||||
case '*'
|
||||
|
||||
set had_cmd 1
|
||||
set res $i
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user