Fix fish completion when having alias on awk or grep

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
This commit is contained in:
Guillaume J. Charmes 2014-03-26 09:05:21 -07:00 committed by Tibor Vass
parent bdebc378c9
commit 69ddbf7e0b
1 changed files with 5 additions and 5 deletions

View File

@ -26,20 +26,20 @@ end
function __fish_print_docker_containers --description 'Print a list of docker containers' -a select function __fish_print_docker_containers --description 'Print a list of docker containers' -a select
switch $select switch $select
case running case running
docker ps -a --no-trunc | awk 'NR>1' | awk 'BEGIN {FS=" +"}; $5 ~ "^Up" {print $1 "\n" $(NF-1)}' | tr ',' '\n' docker ps -a --no-trunc | command awk 'NR>1' | command awk 'BEGIN {FS=" +"}; $5 ~ "^Up" {print $1 "\n" $(NF-1)}' | tr ',' '\n'
case stopped case stopped
docker ps -a --no-trunc | awk 'NR>1' | awk 'BEGIN {FS=" +"}; $5 ~ "^Exit" {print $1 "\n" $(NF-1)}' | tr ',' '\n' docker ps -a --no-trunc | command awk 'NR>1' | command awk 'BEGIN {FS=" +"}; $5 ~ "^Exit" {print $1 "\n" $(NF-1)}' | tr ',' '\n'
case all case all
docker ps -a --no-trunc | awk 'NR>1' | awk 'BEGIN {FS=" +"}; {print $1 "\n" $(NF-1)}' | tr ',' '\n' docker ps -a --no-trunc | command awk 'NR>1' | command awk 'BEGIN {FS=" +"}; {print $1 "\n" $(NF-1)}' | tr ',' '\n'
end end
end end
function __fish_print_docker_images --description 'Print a list of docker images' function __fish_print_docker_images --description 'Print a list of docker images'
docker images | awk 'NR>1' | grep -v '<none>' | awk '{print $1":"$2}' docker images | command awk 'NR>1' | command grep -v '<none>' | command awk '{print $1":"$2}'
end end
function __fish_print_docker_repositories --description 'Print a list of docker repositories' function __fish_print_docker_repositories --description 'Print a list of docker repositories'
docker images | awk 'NR>1' | grep -v '<none>' | awk '{print $1}' | sort | uniq docker images | command awk 'NR>1' | command grep -v '<none>' | command awk '{print $1}' | sort | uniq
end end
# common options # common options