From c46684b1550da8260c8d3d6329685cc9770d6cfe Mon Sep 17 00:00:00 2001 From: Joseph Wayne Norton Date: Fri, 11 May 2012 18:12:31 +0900 Subject: Add 'kerl deploy' command to deploy an installation to a given host and directory --- bash_completion/kerl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bash_completion') diff --git a/bash_completion/kerl b/bash_completion/kerl index 0d1860a..62efa00 100644 --- a/bash_completion/kerl +++ b/bash_completion/kerl @@ -18,9 +18,9 @@ _kerl() RELEASES=`cat "$HOME/.kerl/otp_releases"` fi COMPREPLY=( $( compgen -W "git $RELEASES" -- "$cur") ) - else + else if [ -f "$HOME/.kerl/otp_builds" ]; then - BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` + BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` fi COMPREPLY=( $( compgen -W "$BUILDS" -- "$cur") ) fi @@ -33,10 +33,18 @@ _kerl() ;; install) if [ -f "$HOME/.kerl/otp_builds" ]; then - BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` + BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` fi COMPREPLY=( $( compgen -W "$BUILDS" -- "$cur") ) ;; + deploy) + if [ "$COMP_CWORD" -eq 3 ]; then + if [ -f "$HOME/.kerl/otp_installations" ]; then + PATHS=`cat "$HOME/.kerl/otp_installations" | cut -d " " -f 2` + fi + fi + COMPREPLY=( $( compgen -W "$PATHS" -- "$cur") ) + ;; delete) COMPREPLY=( $( compgen -W "build installation $words" -- "$cur") ) ;; @@ -46,7 +54,7 @@ _kerl() agner) if [ "$COMP_CWORD" -eq 3 ]; then if [ -f "$HOME/.kerl/otp_builds" ]; then - BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` + BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` fi fi COMPREPLY=( $( compgen -W "$BUILDS" -- "$cur") ) @@ -54,7 +62,7 @@ _kerl() *) if [ "$COMP_CWORD" -eq 3 ]; then if [ -f "$HOME/.kerl/otp_builds" ]; then - BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` + BUILDS=`cat "$HOME/.kerl/otp_builds" | cut -d "," -f 2` fi if [ -n "$BUILDS" ]; then for b in $BUILDS; do -- cgit v1.2.3