+SERIAL_PORT=""
+AUTO_SCREEN_SESSION=""
+PROG_NAME=$(basename $0)
+
+# Parse all the command line arguments
+while (( "$#" >= "1" )); do
+ # Scan each argument
+ key="$1"
+ case $key in
+ -a|--autoscreen)
+ AUTO_SCREEN_SESSION="$2"
+ shift
+ ;;
+ -f|--fastload)
+ SERIAL_PORT="$2"
+ shift
+ ;;
+ -h|--help)
+ echo "Usage: $PROG_NAME [options...]"
+ echo ""
+ echo "Loads the most recent built firmware (@TARGET_BIN@) to the device."
+ echo "Requires Cygwin."
+ echo " (winload.teensy)"
+ echo ""
+ echo "Arguments:"
+ echo " -f, --fastload SERIAL_PORT Send the reload command to the debug terminal."
+ echo " e.g. /dev/ttyACM0"
+ echo " NOTE: May not work due to non-functional terminal, or disable remote flashing"
+ echo " -h, --help This message."
+ exit 1
+ ;;
+ *)
+ echo "INVALID ARG: '$1'"
+ exit 2
+ ;;
+ esac
+
+ # Shift to the next argument
+ shift
+done
+
+# First check to see teensy-loader-cli has been compiled