UsingYou can check for both values using extglob@(val1|val2) you can do thissyntax inside [[...]]:
shopt -s extglob
filesplit() {
[[ "${1?needs an argument}" == -@(u|-update) ]] && echo "Update" || echo "No Update"
}
Testing:
filesplit -b
No Update
filesplit -u
Update
filesplit --update
Update
filesplit --update1
No Update
filesplit
-bash: 1: needs an argument