dm: support des aliases pour ssh aussi

This commit is contained in:
Jephté Clain 2020-10-02 09:12:56 +04:00
parent d1d32de841
commit 82a7952e2a
1 changed files with 33 additions and 28 deletions

View File

@ -7,9 +7,12 @@ if [ -n "$UTOOLS_DOCKER_ALIASES" ]; then
# alias dm=docker-machine # alias dm=docker-machine
#fi #fi
function dm() { function dm() {
if [ "$1" == use -a -n "$2" -a -f ~/etc/default/dk ]; then case "$1" in
use|ssh)
if [ -n "$2" -a -f ~/etc/default/dk ]; then
# chercher les aliases éventuels # chercher les aliases éventuels
local machine="$2"; shift; shift local cmd="$1"; shift
local machine="$1"; shift
machine="$( machine="$(
CLUSTERDIRS=() CLUSTERDIRS=()
DM_ALIASES=() DM_ALIASES=()
@ -33,9 +36,11 @@ if [ -n "$UTOOLS_DOCKER_ALIASES" ]; then
fi fi
done done
echo "$machine" echo "$machine"
)" )"
set -- use "$machine" "$@" set -- "$cmd" "$machine" "$@"
fi fi
;;
esac
if [ "$DOCKER_MACHINE_WRAPPED" == true ]; then if [ "$DOCKER_MACHINE_WRAPPED" == true ]; then
__docker_machine_wrapper "$@" __docker_machine_wrapper "$@"
else else