[script][flash_all] Improve Help

This commit is contained in:
Mathieu Maret 2016-02-23 10:03:09 +01:00
parent 5d942bc74b
commit 6ef1691e56

View File

@ -6,9 +6,16 @@ used_serial=""
forbidden_serials="b06474cb" forbidden_serials="b06474cb"
function usage { function usage {
echo -e "Usage: $(basename $0) [-s serialNumber] [IMGLIST]" echo -e "Usage: $(basename $0) [OPTIONS] [FILES]"
echo -e " IMGLIST is a list of file in .img separated by space" echo -e " Flash Android images"
echo -e " If no IMGLIST provied all the .img in the current directory will be flashed" 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" echo -e "e.g. $(basename $0) -s 132456789 out/target/device/boot.img out/target/device/system.img"
} }
@ -28,11 +35,12 @@ function check_fastboot_serial {
echo "Cannot find provided serial $serial: Expecting the device to be rebooting in fastboot mode " echo "Cannot find provided serial $serial: Expecting the device to be rebooting in fastboot mode "
fi fi
used_serial=$serial used_serial=$serial
elif [[ $nb_device != 1 ]]; then else
echo "Error: Too much device connected!" 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" echo " Provide a serial number with -s option or disconnect a device"
exit 1 exit 1
else fi
used_serial=$serials used_serial=$serials
fi fi
check_forbidden_serial $used_serial check_forbidden_serial $used_serial