* 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:
gonchar
2011-09-23 14:51:14 +04:00
parent c66ec4df3d
commit 39a2fd1717
3 changed files with 29 additions and 7 deletions

View File

@@ -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