Created
December 2, 2017 01:42
-
-
Save tomplex/1a71d50104931a4ad4f15b58f4722894 to your computer and use it in GitHub Desktop.
Stop & remove Docker container with completions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
container_stop_rm () { | |
docker rm $(docker stop $1) | |
} | |
_container_stop_rm () { | |
containers=$(docker ps --format '{{ .Names }}') | |
COMPREPLY=( $(compgen -W "$containers" -- "${COMP_WORDS[COMP_CWORD]}" ) ) | |
} | |
complete -F _container_stop_rm container_stop_rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment