#compdef espflash

autoload -U is-at-least

_espflash() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_espflash_commands" \
"*::: :->espflash" \
&& ret=0
    case $state in
    (espflash)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:espflash-command-$line[1]:"
        case $line[1] in
            (board-info)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':shell -- Shell to generate completions for:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(erase-flash)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(erase-parts)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'--partition-table=[Input partition table]:FILE:_files' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'*::erase_parts -- Labels of the partitions to be erased:_default' \
&& ret=0
;;
(erase-region)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':addr -- Offset to start erasing from:_default' \
':size -- Size of the region to erase:_default' \
&& ret=0
;;
(flash)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-f+[Flash frequency]:FREQ:((12mhz\:"12 MHz"
15mhz\:"15 MHz"
16mhz\:"16 MHz"
20mhz\:"20 MHz"
24mhz\:"24 MHz"
26mhz\:"26 MHz"
30mhz\:"30 MHz"
40mhz\:"40 MHz"
48mhz\:"48 MHz"
60mhz\:"60 MHz"
80mhz\:"80 MHz"))' \
'--flash-freq=[Flash frequency]:FREQ:((12mhz\:"12 MHz"
15mhz\:"15 MHz"
16mhz\:"16 MHz"
20mhz\:"20 MHz"
24mhz\:"24 MHz"
26mhz\:"26 MHz"
30mhz\:"30 MHz"
40mhz\:"40 MHz"
48mhz\:"48 MHz"
60mhz\:"60 MHz"
80mhz\:"80 MHz"))' \
'-m+[Flash mode to use]:MODE:((qio\:"Quad I/O (4 pins used for address & data)"
qout\:"Quad Output (4 pins used for data)"
dio\:"Dual I/O (2 pins used for address & data)"
dout\:"Dual Output (2 pins used for data)"))' \
'--flash-mode=[Flash mode to use]:MODE:((qio\:"Quad I/O (4 pins used for address & data)"
qout\:"Quad Output (4 pins used for data)"
dio\:"Dual I/O (2 pins used for address & data)"
dout\:"Dual Output (2 pins used for data)"))' \
'-s+[Flash size of the target]:SIZE:((256kb\:"256 KB"
512kb\:"512 KB"
1mb\:"1 MB"
2mb\:"2 MB"
4mb\:"4 MB"
8mb\:"8 MB"
16mb\:"16 MB"
32mb\:"32 MB"
64mb\:"64 MB"
128mb\:"128 MB"
256mb\:"256 MB"))' \
'--flash-size=[Flash size of the target]:SIZE:((256kb\:"256 KB"
512kb\:"512 KB"
1mb\:"1 MB"
2mb\:"2 MB"
4mb\:"4 MB"
8mb\:"8 MB"
16mb\:"16 MB"
32mb\:"32 MB"
64mb\:"64 MB"
128mb\:"128 MB"
256mb\:"256 MB"))' \
'*--erase-parts=[Erase partitions by label]:LABELS:_default' \
'*--erase-data-parts=[Erase specified data partitions]:PARTS:_default' \
'-L+[Logging format]:LOG_FORMAT:((defmt\:"defmt"
serial\:"serial"))' \
'--log-format=[Logging format]:LOG_FORMAT:((defmt\:"defmt"
serial\:"serial"))' \
'--monitor-baud=[Baud rate at which to read console output]:BAUD:_default' \
'--bootloader=[Path to a binary (.bin) bootloader file]:FILE:_files' \
'-T+[Path to a CSV file containing partition table]:FILE:_files' \
'--partition-table=[Path to a CSV file containing partition table]:FILE:_files' \
'--partition-table-offset=[Partition table offset]:OFFSET:_default' \
'--target-app-partition=[Label of target app partition]:LABEL:_default' \
'--min-chip-rev=[Minimum chip revision supported by image, in format\: major.minor]:MIN_CHIP_REV:_default' \
'--processors=[External log processors to use (comma separated executables)]:PROCESSORS:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-M[Open a serial monitor after flashing]' \
'--monitor[Open a serial monitor after flashing]' \
'--ram[Load the application to RAM instead of Flash]' \
'--no-verify[Don'\''t verify the flash contents after flashing]' \
'--no-skip[Don'\''t skip flashing of parts with matching checksum]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':image -- ELF image to flash:_files' \
&& ret=0
;;
(hold-in-reset)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(monitor)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-e+[Optional file name of the ELF image to load the symbols from]:FILE:_files' \
'--elf=[Optional file name of the ELF image to load the symbols from]:FILE:_files' \
'-L+[Logging format]:LOG_FORMAT:((defmt\:"defmt"
serial\:"serial"))' \
'--log-format=[Logging format]:LOG_FORMAT:((defmt\:"defmt"
serial\:"serial"))' \
'--processors=[External log processors to use (comma separated executables)]:PROCESSORS:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'--non-interactive[Avoids asking the user for interactions like resetting the device]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(partition-table)
_arguments "${_arguments_options[@]}" : \
'-o+[Optional output file name, if unset will output to stdout]:FILE:_files' \
'--output=[Optional output file name, if unset will output to stdout]:FILE:_files' \
'(--to-csv)--to-binary[Convert CSV partition table to binary representation]' \
'(--to-binary)--to-csv[Convert binary partition table to CSV representation]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':partition_table -- Input partition table:_files' \
&& ret=0
;;
(read-flash)
_arguments "${_arguments_options[@]}" : \
'--block-size=[Size of each individual packet of data]:BLOCK_SIZE:_default' \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'--max-in-flight=[Maximum number of un-acked packets]:MAX_IN_FLIGHT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':addr -- Offset to start reading from:_default' \
':size -- Size of the region to read:_default' \
':file -- Name of binary dump:_files' \
&& ret=0
;;
(reset)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(save-image)
_arguments "${_arguments_options[@]}" : \
'-f+[Flash frequency]:FREQ:((12mhz\:"12 MHz"
15mhz\:"15 MHz"
16mhz\:"16 MHz"
20mhz\:"20 MHz"
24mhz\:"24 MHz"
26mhz\:"26 MHz"
30mhz\:"30 MHz"
40mhz\:"40 MHz"
48mhz\:"48 MHz"
60mhz\:"60 MHz"
80mhz\:"80 MHz"))' \
'--flash-freq=[Flash frequency]:FREQ:((12mhz\:"12 MHz"
15mhz\:"15 MHz"
16mhz\:"16 MHz"
20mhz\:"20 MHz"
24mhz\:"24 MHz"
26mhz\:"26 MHz"
30mhz\:"30 MHz"
40mhz\:"40 MHz"
48mhz\:"48 MHz"
60mhz\:"60 MHz"
80mhz\:"80 MHz"))' \
'-m+[Flash mode to use]:MODE:((qio\:"Quad I/O (4 pins used for address & data)"
qout\:"Quad Output (4 pins used for data)"
dio\:"Dual I/O (2 pins used for address & data)"
dout\:"Dual Output (2 pins used for data)"))' \
'--flash-mode=[Flash mode to use]:MODE:((qio\:"Quad I/O (4 pins used for address & data)"
qout\:"Quad Output (4 pins used for data)"
dio\:"Dual I/O (2 pins used for address & data)"
dout\:"Dual Output (2 pins used for data)"))' \
'-s+[Flash size of the target]:SIZE:((256kb\:"256 KB"
512kb\:"512 KB"
1mb\:"1 MB"
2mb\:"2 MB"
4mb\:"4 MB"
8mb\:"8 MB"
16mb\:"16 MB"
32mb\:"32 MB"
64mb\:"64 MB"
128mb\:"128 MB"
256mb\:"256 MB"))' \
'--flash-size=[Flash size of the target]:SIZE:((256kb\:"256 KB"
512kb\:"512 KB"
1mb\:"1 MB"
2mb\:"2 MB"
4mb\:"4 MB"
8mb\:"8 MB"
16mb\:"16 MB"
32mb\:"32 MB"
64mb\:"64 MB"
128mb\:"128 MB"
256mb\:"256 MB"))' \
'--chip=[Chip to create an image for]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-x+[Cristal frequency of the target]:XTAL_FREQ:((26mhz\:"26 MHz"
32mhz\:"32 MHz"
40mhz\:"40 MHz"))' \
'--xtal-freq=[Cristal frequency of the target]:XTAL_FREQ:((26mhz\:"26 MHz"
32mhz\:"32 MHz"
40mhz\:"40 MHz"))' \
'--bootloader=[Path to a binary (.bin) bootloader file]:FILE:_files' \
'-T+[Path to a CSV file containing partition table]:FILE:_files' \
'--partition-table=[Path to a CSV file containing partition table]:FILE:_files' \
'--partition-table-offset=[Partition table offset]:OFFSET:_default' \
'--target-app-partition=[Label of target app partition]:LABEL:_default' \
'--min-chip-rev=[Minimum chip revision supported by image, in format\: major.minor]:MIN_CHIP_REV:_default' \
'--merge[Boolean flag to merge binaries into single binary]' \
'-P[Don'\''t pad the image to the flash size]' \
'--skip-padding[Don'\''t pad the image to the flash size]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':image -- ELF image to flash:_files' \
':file -- File name to save the generated image to:_files' \
&& ret=0
;;
(write-bin)
_arguments "${_arguments_options[@]}" : \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':addr -- Address at which to write the binary file:_default' \
':bin_file -- File containing the binary data to write:_default' \
&& ret=0
;;
(checksum-md5)
_arguments "${_arguments_options[@]}" : \
'-a+[Start address]:ADDRESS:_default' \
'--address=[Start address]:ADDRESS:_default' \
'-l+[Length]:LENGTH:_default' \
'--length=[Length]:LENGTH:_default' \
'-a+[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'--after=[Reset operation to perform after connecting to the target]:AFTER:((hard-reset\:"The DTR serial control line is used to reset the chip into a normal boot sequence"
no-reset\:"Leaves the chip in the serial bootloader, no reset is performed"
no-reset-no-stub\:"Leaves the chip in the stub bootloader, no reset is performed"))' \
'-B+[Baud rate at which to communicate with target device]:BAUD:_default' \
'--baud=[Baud rate at which to communicate with target device]:BAUD:_default' \
'-b+[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'--before=[Reset operation to perform before connecting to the target]:BEFORE:((default-reset\:"Uses DTR & RTS serial control lines to try to reset the chip into bootloader mode"
no-reset\:"Skips DTR/RTS control signal assignments and just start sending a serial synchronisation command to the chip"
no-reset-no-sync\:"Skips DTR/RTS control signal assignments and also skips the serial synchronization command"
usb-reset\:"Reset sequence for USB-JTAG-Serial peripheral"))' \
'-c+[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'--chip=[Target device]:CHIP:((esp32\:"ESP32"
esp32c2\:"ESP32-C2, ESP8684"
esp32c3\:"ESP32-C3, ESP8685"
esp32c6\:"ESP32-C6"
esp32h2\:"ESP32-H2"
esp32p4\:"ESP32-P4"
esp32s2\:"ESP32-S2"
esp32s3\:"ESP32-S3"))' \
'-p+[Serial port connected to target device]:PORT:_default' \
'--port=[Serial port connected to target device]:PORT:_default' \
'-C[Require confirmation before auto-connecting to a recognized device]' \
'--confirm-port[Require confirmation before auto-connecting to a recognized device]' \
'--list-all-ports[List all available ports]' \
'--no-stub[Do not use the RAM stub for loading]' \
'-S[Do not check for updates]' \
'--skip-update-check[Do not check for updates]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_espflash__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:espflash-help-command-$line[1]:"
        case $line[1] in
            (board-info)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(erase-flash)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(erase-parts)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(erase-region)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(flash)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(hold-in-reset)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(monitor)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(partition-table)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(read-flash)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(reset)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(save-image)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(write-bin)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(checksum-md5)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_espflash_commands] )) ||
_espflash_commands() {
    local commands; commands=(
'board-info:Print information about a connected target device' \
'completions:Generate completions for the given shell' \
'erase-flash:Erase Flash entirely' \
'erase-parts:Erase specified partitions' \
'erase-region:Erase specified region' \
'flash:Flash an application in ELF format to a connected target device' \
'hold-in-reset:Hold the target device in reset' \
'monitor:Open the serial monitor without flashing the connected target device' \
'partition-table:Convert partition tables between CSV and binary format' \
'read-flash:Read SPI flash content' \
'reset:Reset the target device' \
'save-image:Generate a binary application image and save it to a local disk' \
'write-bin:Write a binary file to a specific address in a target device'\''s flash' \
'checksum-md5:Calculate the MD5 checksum of the given region' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'espflash commands' commands "$@"
}
(( $+functions[_espflash__board-info_commands] )) ||
_espflash__board-info_commands() {
    local commands; commands=()
    _describe -t commands 'espflash board-info commands' commands "$@"
}
(( $+functions[_espflash__checksum-md5_commands] )) ||
_espflash__checksum-md5_commands() {
    local commands; commands=()
    _describe -t commands 'espflash checksum-md5 commands' commands "$@"
}
(( $+functions[_espflash__completions_commands] )) ||
_espflash__completions_commands() {
    local commands; commands=()
    _describe -t commands 'espflash completions commands' commands "$@"
}
(( $+functions[_espflash__erase-flash_commands] )) ||
_espflash__erase-flash_commands() {
    local commands; commands=()
    _describe -t commands 'espflash erase-flash commands' commands "$@"
}
(( $+functions[_espflash__erase-parts_commands] )) ||
_espflash__erase-parts_commands() {
    local commands; commands=()
    _describe -t commands 'espflash erase-parts commands' commands "$@"
}
(( $+functions[_espflash__erase-region_commands] )) ||
_espflash__erase-region_commands() {
    local commands; commands=()
    _describe -t commands 'espflash erase-region commands' commands "$@"
}
(( $+functions[_espflash__flash_commands] )) ||
_espflash__flash_commands() {
    local commands; commands=()
    _describe -t commands 'espflash flash commands' commands "$@"
}
(( $+functions[_espflash__help_commands] )) ||
_espflash__help_commands() {
    local commands; commands=(
'board-info:Print information about a connected target device' \
'completions:Generate completions for the given shell' \
'erase-flash:Erase Flash entirely' \
'erase-parts:Erase specified partitions' \
'erase-region:Erase specified region' \
'flash:Flash an application in ELF format to a connected target device' \
'hold-in-reset:Hold the target device in reset' \
'monitor:Open the serial monitor without flashing the connected target device' \
'partition-table:Convert partition tables between CSV and binary format' \
'read-flash:Read SPI flash content' \
'reset:Reset the target device' \
'save-image:Generate a binary application image and save it to a local disk' \
'write-bin:Write a binary file to a specific address in a target device'\''s flash' \
'checksum-md5:Calculate the MD5 checksum of the given region' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'espflash help commands' commands "$@"
}
(( $+functions[_espflash__help__board-info_commands] )) ||
_espflash__help__board-info_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help board-info commands' commands "$@"
}
(( $+functions[_espflash__help__checksum-md5_commands] )) ||
_espflash__help__checksum-md5_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help checksum-md5 commands' commands "$@"
}
(( $+functions[_espflash__help__completions_commands] )) ||
_espflash__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help completions commands' commands "$@"
}
(( $+functions[_espflash__help__erase-flash_commands] )) ||
_espflash__help__erase-flash_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help erase-flash commands' commands "$@"
}
(( $+functions[_espflash__help__erase-parts_commands] )) ||
_espflash__help__erase-parts_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help erase-parts commands' commands "$@"
}
(( $+functions[_espflash__help__erase-region_commands] )) ||
_espflash__help__erase-region_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help erase-region commands' commands "$@"
}
(( $+functions[_espflash__help__flash_commands] )) ||
_espflash__help__flash_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help flash commands' commands "$@"
}
(( $+functions[_espflash__help__help_commands] )) ||
_espflash__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help help commands' commands "$@"
}
(( $+functions[_espflash__help__hold-in-reset_commands] )) ||
_espflash__help__hold-in-reset_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help hold-in-reset commands' commands "$@"
}
(( $+functions[_espflash__help__monitor_commands] )) ||
_espflash__help__monitor_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help monitor commands' commands "$@"
}
(( $+functions[_espflash__help__partition-table_commands] )) ||
_espflash__help__partition-table_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help partition-table commands' commands "$@"
}
(( $+functions[_espflash__help__read-flash_commands] )) ||
_espflash__help__read-flash_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help read-flash commands' commands "$@"
}
(( $+functions[_espflash__help__reset_commands] )) ||
_espflash__help__reset_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help reset commands' commands "$@"
}
(( $+functions[_espflash__help__save-image_commands] )) ||
_espflash__help__save-image_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help save-image commands' commands "$@"
}
(( $+functions[_espflash__help__write-bin_commands] )) ||
_espflash__help__write-bin_commands() {
    local commands; commands=()
    _describe -t commands 'espflash help write-bin commands' commands "$@"
}
(( $+functions[_espflash__hold-in-reset_commands] )) ||
_espflash__hold-in-reset_commands() {
    local commands; commands=()
    _describe -t commands 'espflash hold-in-reset commands' commands "$@"
}
(( $+functions[_espflash__monitor_commands] )) ||
_espflash__monitor_commands() {
    local commands; commands=()
    _describe -t commands 'espflash monitor commands' commands "$@"
}
(( $+functions[_espflash__partition-table_commands] )) ||
_espflash__partition-table_commands() {
    local commands; commands=()
    _describe -t commands 'espflash partition-table commands' commands "$@"
}
(( $+functions[_espflash__read-flash_commands] )) ||
_espflash__read-flash_commands() {
    local commands; commands=()
    _describe -t commands 'espflash read-flash commands' commands "$@"
}
(( $+functions[_espflash__reset_commands] )) ||
_espflash__reset_commands() {
    local commands; commands=()
    _describe -t commands 'espflash reset commands' commands "$@"
}
(( $+functions[_espflash__save-image_commands] )) ||
_espflash__save-image_commands() {
    local commands; commands=()
    _describe -t commands 'espflash save-image commands' commands "$@"
}
(( $+functions[_espflash__write-bin_commands] )) ||
_espflash__write-bin_commands() {
    local commands; commands=()
    _describe -t commands 'espflash write-bin commands' commands "$@"
}

if [ "$funcstack[1]" = "_espflash" ]; then
    _espflash "$@"
else
    compdef _espflash espflash
fi
