diff --git a/src/azure/Login.sh b/src/azure/auth/Login.sh similarity index 100% rename from src/azure/Login.sh rename to src/azure/auth/Login.sh diff --git a/src/azure/auth/driver.sh b/src/azure/auth/driver.sh new file mode 100644 index 00000000..44c42c0e --- /dev/null +++ b/src/azure/auth/driver.sh @@ -0,0 +1,26 @@ +authUsage() { + echo "Usage: $0 credential [command]" + echo "Commands:" + echo " login - Login azure as service-principal" + exit 1 +} + +function auth(){ + + # Check if at least one argument is provided + if [ $# -eq 0 ]; then + authUsage + fi + + # Execute the appropriate command + case "$1" in + login) + login + ;; + *) + echo "Error: Invalid command." + authUsage + ;; + esac + +} \ No newline at end of file diff --git a/src/azure/auth/loadScripts.sh b/src/azure/auth/loadScripts.sh new file mode 100644 index 00000000..2a815f46 --- /dev/null +++ b/src/azure/auth/loadScripts.sh @@ -0,0 +1,2 @@ +source auth/Login.sh +source auth/driver.sh \ No newline at end of file diff --git a/src/azure/credential/credentialDriver.sh b/src/azure/credential/driver.sh similarity index 100% rename from src/azure/credential/credentialDriver.sh rename to src/azure/credential/driver.sh diff --git a/src/azure/credential/loadScripts.sh b/src/azure/credential/loadScripts.sh index 2a388494..13013aa4 100644 --- a/src/azure/credential/loadScripts.sh +++ b/src/azure/credential/loadScripts.sh @@ -1,4 +1,4 @@ -source credential/credentialDriver.sh +source credential/driver.sh source credential/SetupCred.sh source credential/ShowCreds.sh source credential/UpdateCreds.sh diff --git a/src/azure/driver.sh b/src/azure/driver.sh index 11673f47..3476f1ae 100644 --- a/src/azure/driver.sh +++ b/src/azure/driver.sh @@ -3,19 +3,17 @@ source config.sh source loadScripts.sh -usage() { - echo "Usage: $0 [command]" - echo "Commands:" - echo " init - Initialize and store new credentials" - echo " update - Update existing credentials" - echo " show - Display current credentials" - echo " login - Login azure as service-principal" +rootUsage() { + echo "Usage: $0 [command group] [command]" + echo "Command groups:" + echo " credential - Manage credentials (init, update, show)" + echo " auth - Authentication management (login)" exit 1 } # Check if at least one argument is provided if [ $# -eq 0 ]; then - usage + rootUsage fi # Execute the appropriate command @@ -23,11 +21,11 @@ case "$1" in credential) credential "$2" ;; - login) - login + auth) + auth "$2" ;; *) echo "Error: Invalid command." - usage + rootUsage ;; esac diff --git a/src/azure/loadScripts.sh b/src/azure/loadScripts.sh index fe8f0013..59b8675f 100644 --- a/src/azure/loadScripts.sh +++ b/src/azure/loadScripts.sh @@ -1,3 +1,3 @@ source credential/loadScripts.sh +source auth/loadScripts.sh -source Login.sh