From de8819810c4496e37d9ca91022bdb5d8aa16da04 Mon Sep 17 00:00:00 2001
From: Carla Ourofino <ourofino@tecgraf.puc-rio.br>
Date: Wed, 25 Mar 2020 14:26:13 -0300
Subject: [PATCH] Troca --sga-name para --sga_name, valida argumentos e permite
 uso do "=" ao passar o valor.

[SOMA-3827][SOMA-4104]
---
 sgad.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/sgad.sh b/sgad.sh
index a3ae159..93fb4e0 100755
--- a/sgad.sh
+++ b/sgad.sh
@@ -18,11 +18,21 @@ POSITIONAL="" # String para salvar argumentos passados ao comando
 while [ $# -gt 0 ] # Percorre todos argumentos
 do
    case "$1" in
-      --sga-name)
-         sga_name=$2
+      --sga_name)
+         sga_name="$2"
          shift
          shift
          ;;
+      --sga_name=*)
+         sga_name="${1#*=}"
+         shift
+         ;;
+      --*)
+         echo "$0: unrecognized option '$1'"
+         echo "Available options are:"
+         echo "  --sga_name  SGA name to get config from a multiple config file"
+         exit 1
+         ;;
       *)
          POSITIONAL="${POSITIONAL} $1"
          shift
-- 
GitLab