Skip to content

Commit

Permalink
fix: if no recognized command is provided, show help (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianBuzzo authored Feb 21, 2024
1 parent f117007 commit 87a628f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ezsops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ log_verbose() {

ezsops_decrypt() {
if [ -z "$1" ]; then
echo "Usage: decrypt_sops <path/to/sops.filename.yml>"
echo "Usage: ezsops decrypt <path/to/sops.filename.yml>"
return 1
fi

Expand All @@ -43,7 +43,7 @@ ezsops_decrypt() {

ezsops_encrypt() {
if [ -z "$1" ]; then
echo "Usage: encrypt_sops <path/to/filename.yml>"
echo "Usage: ezsops encrypt <path/to/filename.yml>"
return 1
fi

Expand Down Expand Up @@ -138,10 +138,11 @@ ezsops_encrypt() {
ezsops () {
if [ "$1" = "encrypt" ]; then
ezsops_encrypt "${@:2}"
fi

if [ "$1" = "decrypt" ]; then
elif [ "$1" = "decrypt" ]; then
ezsops_decrypt "${@:2}"
else
echo "Usage: ezsops <encrypt|decrypt> [args]"
return 1
fi
}

Expand Down

0 comments on commit 87a628f

Please sign in to comment.