Skip to content

Commit

Permalink
Completions: Don't check $cmd[1]
Browse files Browse the repository at this point in the history
This is already done by fish before calling the completion.

It breaks completion with combiners (#2025) and also with wrappers.

(This does not include git because that's better solved in #2145)
  • Loading branch information
faho committed Aug 17, 2015
1 parent cb5d36d commit 5e555fc
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion share/completions/brew.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function __fish_brew_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'brew' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/bundle.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function __fish_bundle_no_command --description 'Test if bundle has been given no subcommand'
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'bundle' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
6 changes: 1 addition & 5 deletions share/completions/composer.fish
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
function __fish_composer_needs_command
set cmd (commandline -opc)

if [ (count $cmd) -eq 1 -a $cmd[1] = 'composer' ]
return 0
end

if [ (count $cmd) -eq 1 -a $cmd[1] = 'composer.phar' ]
if [ (count $cmd) -eq 1 ]
return 0
end

Expand Down
2 changes: 1 addition & 1 deletion share/completions/heroku.fish
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end

function __fish_heroku_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'heroku' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/lein.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function __fish_lein_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'lein' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/mix.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function __fish_mix_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'mix' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/netctl.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function __fish_netctl_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'netctl' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/npm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
function __fish_npm_needs_command
set cmd (commandline -opc)

if [ (count $cmd) -eq 1 -a $cmd[1] = 'npm' ]
if [ (count $cmd) -eq 1 ]
return 0
end

Expand Down
2 changes: 1 addition & 1 deletion share/completions/opam.fish
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ end

function __fish_opam_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'opam' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/rbenv.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function __fish_rbenv_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'rbenv' ]
if [ (count $cmd) -eq 1 ]
return 0
end

Expand Down
2 changes: 1 addition & 1 deletion share/completions/ruby-build.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function __fish_ruby-build_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'ruby-build' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down
2 changes: 1 addition & 1 deletion share/completions/travis.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function __fish_travis_needs_command
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'travis' ]
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
Expand Down

0 comments on commit 5e555fc

Please sign in to comment.