Skip to content

Commit

Permalink
[fix codestarterorg#11] retreive args after options if any provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Idem committed Dec 24, 2014
1 parent ef71402 commit 2e8ea18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ run_command_chroot(){
#Required arguments

#Optional arguments
while getopts "hvk" option; do
while getopts "hv" option; do
case $option in
h)
usage
Expand All @@ -146,8 +146,8 @@ while getopts "hvk" option; do
esac
done

device_model="${BASH_ARGV[0]}"
device_search="${BASH_ARGV[1]}"
device_model="${@:$OPTIND:1}"
device_search="${@:$OPTIND+1:1}"

# Default to "acer-720" if no other args are sent
if [ "$device_model" == "" ] && [ "$device_search" = "" ];then
Expand Down

0 comments on commit 2e8ea18

Please sign in to comment.