fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Remo Senekowitschcompletions/dive: add image tags from podmanf5ff9aac2

master
966 B22 linesraw
1# Completion for dive: https://github.com/wagoodman/dive
2
3# Builtin options and subcommands
4dive completion fish | source
5
6# Arguments
7function __fish_docker_or_podman_image_tags
8    command -v docker >/dev/null
9    set --local docker_status $status
10    command -v podman >/dev/null
11    set --local podman_status $status
12
13    if test $docker_status -eq 0 && test $podman_status -eq 0
14        docker images --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | command grep -v '<none>' | sed 's#^#docker://#'
15        podman images --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | command grep -v '<none>' | sed 's#^#podman://#'
16    else if test $docker_status -eq 0
17        docker images --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | command grep -v '<none>'
18    else if test $podman_status -eq 0
19        podman images --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | command grep -v '<none>'
20    end
21end
22complete -c dive -xa "(__fish_docker_or_podman_image_tags)"