Allow overriding the STACK_NAME..

..to be able to run e.g. `abra -a traefik logs traefik`
This commit is contained in:
3wc 2020-09-11 12:58:59 +02:00
parent 348e4ca255
commit ea79ad809a
1 changed files with 6 additions and 1 deletions

7
abra
View File

@ -12,7 +12,7 @@ if type direnv 2>&1 > /dev/null && ! direnv status | grep -q 'Found RC allowed t
fi fi
sub_help(){ sub_help(){
echo "Usage: $PROGRAM_NAME <subcommand> [options]" echo "Usage: $PROGRAM_NAME [-a STACK_NAME] <subcommand> [options]"
echo "" echo ""
echo "Subcommands:" echo "Subcommands:"
echo " run SERVICE [CMD] run a command in the specified service's container" echo " run SERVICE [CMD] run a command in the specified service's container"
@ -93,6 +93,11 @@ sub_logs (){
--timestamps --timestamps
} }
if [ $1 == "-a" ]; then
STACK_NAME=$2
shift 2
fi
subcommand=$1 subcommand=$1
case $subcommand in case $subcommand in
"" | "-h" | "--help") "" | "-h" | "--help")