use container name as completion

This commit is contained in:
Tin Lai 2020-06-18 13:30:08 +10:00
parent cac9973955
commit 4f4b374857
1 changed files with 3 additions and 3 deletions

View File

@ -26,11 +26,11 @@ end
function __fish_print_docker_containers --description 'Print a list of docker containers' -a select
switch $select
case running
docker ps -a --no-trunc --filter status=running --format "{{.ID}}\t{{.Names}}" | tr ',' '\n'
docker ps -a --no-trunc --filter status=running --format "{{.Names}}\t{{.ID}}" | tr ',' '\n'
case stopped
docker ps -a --no-trunc --filter status=exited --format "{{.ID}}\t{{.Names}}" | tr ',' '\n'
docker ps -a --no-trunc --filter status=exited --format "{{.Names}}\t{{.ID}}" | tr ',' '\n'
case all
docker ps -a --no-trunc --format "{{.ID}}\t{{.Names}}" | tr ',' '\n'
docker ps -a --no-trunc --format "{{.Names}}\t{{.ID}}" | tr ',' '\n'
end
end