[script][flash_all] Improve Help

This commit is contained in:
Mathieu Maret 2016-02-23 10:03:09 +01:00
parent 5d942bc74b
commit 6ef1691e56
1 changed files with 16 additions and 8 deletions

View File

@ -6,10 +6,17 @@ used_serial=""
forbidden_serials="b06474cb"
function usage {
echo -e "Usage: $(basename $0) [-s serialNumber] [IMGLIST]"
echo -e " IMGLIST is a list of file in .img separated by space"
echo -e " If no IMGLIST provied all the .img in the current directory will be flashed"
echo -e " e.g. $(basename $0) -s 132456789 out/target/device/boot.img out/target/device/system.img"
echo -e "Usage: $(basename $0) [OPTIONS] [FILES]"
echo -e " Flash Android images"
echo -e ""
echo -e "Available options:"
echo -e " -s Specify the serial number of the device to flash"
echo -e " If not provided, only one device should be connected in fastboot mode or in adb mode"
echo -e " -w Wipe cache and data partition after flashing"
echo -e ""
echo -e "FILES is a list of file in .img separated by space"
echo -e "If no FILES provied all the .img in the current directory will be flashed"
echo -e "e.g. $(basename $0) -s 132456789 out/target/device/boot.img out/target/device/system.img"
}
function check_forbidden_serial {
@ -28,11 +35,12 @@ function check_fastboot_serial {
echo "Cannot find provided serial $serial: Expecting the device to be rebooting in fastboot mode "
fi
used_serial=$serial
elif [[ $nb_device != 1 ]]; then
echo "Error: Too much device connected!"
echo " Provide a serial number with -s option or disconnect a device"
exit 1
else
if [[ $nb_device != 1 ]]; then
echo "Error: Too much or no device connected!"
echo " Provide a serial number with -s option or disconnect a device"
exit 1
fi
used_serial=$serials
fi
check_forbidden_serial $used_serial