FULL_ARGS="$*"
ACTION="$1"
- shift
-
- if [ "$(echo \"$1\" | grep \"^-\" >/dev/null)" = false ]; then
- SUBACTION="$1"
+ if [ $# -gt 0 ]; then
shift
fi
+ echo "$1" | grep "^-" >/dev/null
+ if [ $? -eq 1 ]; then
+ SUBACTION="$1"
+ if [ $# -gt 0 ]; then
+ shift
+ fi
+ fi
if [ "$ACTION" = "update" ]; then
update "$@"