Skip to content

Commit

Permalink
add help command
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Apr 26, 2024
1 parent b677870 commit 7f52359
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions holesky/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ while [ $# -gt 0 ]; do
;;
*) # Unknown flag
echo "Unknown option: $1"
show_help
exit 1
;;
esac
Expand All @@ -56,21 +57,25 @@ done
# Check if flags are provided
if [ -z "$OPERATION_TYPE" ]; then
echo "--operation-type is required."
show_help
exit 1
fi

if [ "$OPERATION_TYPE" != "list-quorums" ] && [ -z "$NODE_ECDSA_KEY_FILE_HOST" ]; then
echo "--node-ecdsa-key-file-host is required."
show_help
exit 1
fi

if [ "$OPERATION_TYPE" != "list-quorums" ] && [ -z "$NODE_ECDSA_KEY_PASSWORD" ]; then
echo "--node-ecdsa-key-password is required."
show_help
exit 1
fi

if { [ "$OPERATION_TYPE" = "opt-in" ] || [ "$OPERATION_TYPE" = "opt-out" ]; } && [ -z "$QUORUMS" ] ; then
echo "--quorum is required for opt-in or opt-out operation."
show_help
exit 1
fi

Expand Down Expand Up @@ -154,4 +159,5 @@ elif [ "$OPERATION_TYPE" = "update-socket" ]; then
updateSocket
else
echo "Invalid command"
show_helps
fi

0 comments on commit 7f52359

Please sign in to comment.