Skip to content

Commit

Permalink
Complete profile when one command is in progress
Browse files Browse the repository at this point in the history
Currently profile completes without arguments, but as soon as you have
written p and try to complete the completion will disappear and have no
match. This fixes this by also including it when a command is
provided and fish will filter it out if it does not match the current
token.
  • Loading branch information
terlar committed Apr 21, 2020
1 parent 25fa5c4 commit be5df95
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions completions/aws.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
function __aws_complete_root
test (count (commandline -o)) = 1
end

function __aws_complete
if set -q aws_completer_path
set -lx COMP_SHELL fish
Expand All @@ -12,5 +8,5 @@ function __aws_complete
end

complete --command aws --no-files --arguments '(__aws_complete)'
complete --command aws --no-files --condition '__aws_complete_root' --arguments profile -d 'Get or set current profile'
complete --command aws --no-files --condition 'test (count (commandline -opc)) -lt 2' --arguments profile -d 'Get or set current profile'
complete --command aws --no-files --condition '__fish_seen_subcommand_from profile' --arguments '(aws profiles)'

0 comments on commit be5df95

Please sign in to comment.