diff --git a/pmos/rotate.sh b/pmos/rotate.sh index 0ab90e6..ed7d59d 100755 --- a/pmos/rotate.sh +++ b/pmos/rotate.sh @@ -39,7 +39,6 @@ function usage() { echo " then the first item will be chosen" echo " without configure the input device for the current orientation" echo "" - exit 1 } @@ -145,7 +144,9 @@ function configure_input() { # parse arguments SHOW_USAGE= +CHANGED= while [ "$#" != "0" ]; do + IS_CMD=1 if [ "$1" = "kbon" ]; then echo "open screen keyboard" run_keyboard @@ -162,12 +163,13 @@ while [ "$#" != "0" ]; do rotate_screen "$ROT" else echo "unknown command: $1" - SHOW_USAGE=1 + IS_CMD= fi + + if [ -n "$IS_CMD" ]; then CHANGED=1; else SHOW_USAGE=1; fi shift done - -configure_input [ -z "$SHOW_USAGE" ] || usage +( [ -n "$SHOW_USAGE" ] && [ -z "$CHANGED" ] ) || configure_input