Giving a list of commands if invalid commands or no command sent

This commit is contained in:
Siina Mashek 2024-10-14 11:03:07 +03:00
parent 69963e62ba
commit 7888735e2d

View File

@ -20,7 +20,7 @@ if [[ -z "$ICLOUD_USERNAME" ]]; then
exit 1 exit 1
fi fi
# tmux session name # Set tmux session name
session="icloudsync" session="icloudsync"
attach () { attach () {
@ -63,8 +63,9 @@ status () {
fi fi
} }
msg="available commands are: start, stop, attach, status"
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
echo "Available commands are: start, stop, attach, status" echo $msg
fi fi
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -82,5 +83,7 @@ while [[ $# -gt 0 ]]; do
status status
;; ;;
esac esac
echo $msg
exit exit
done done