#compdef eim

autoload -U is-at-least

_eim() {
    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[@]}" : \
'-l+[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--locale=[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--log-file=[file in which logs will be stored (default\: eim.log)]:LOG_FILE:_default' \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_eim_commands" \
"*::: :->eim" \
&& ret=0
    case $state in
    (eim)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:eim-command-$line[1]:"
        case $line[1] in
            (install)
_arguments "${_arguments_options[@]}" : \
'-p+[Base Path to which all the files and folder will be installed. For the \`fix\` command, this is the path of the existing installation to fix.]:PATH:_default' \
'--path=[Base Path to which all the files and folder will be installed. For the \`fix\` command, this is the path of the existing installation to fix.]:PATH:_default' \
'-c+[]:FILE:_files' \
'--config=[]:FILE:_files' \
'-t+[You can provide multiple targets separated by comma]:TARGET:_default' \
'--target=[You can provide multiple targets separated by comma]:TARGET:_default' \
'-i+[you can provide multiple versions of ESP-IDF separated by comma, you can also specify exact commit hash]:IDF_VERSIONS:_default' \
'--idf-versions=[you can provide multiple versions of ESP-IDF separated by comma, you can also specify exact commit hash]:IDF_VERSIONS:_default' \
'--tool-download-folder-name=[]:TOOL_DOWNLOAD_FOLDER_NAME:_default' \
'--tool-install-folder-name=[]:TOOL_INSTALL_FOLDER_NAME:_default' \
'--tools-json-file=[Path to tools.json file relative from ESP-IDF installation folder]:TOOLS_JSON_FILE:_default' \
'-n+[]:NON_INTERACTIVE:(true false)' \
'--non-interactive=[]:NON_INTERACTIVE:(true false)' \
'-m+[URL for tools download mirror to be used instead of github.com]:MIRROR:_default' \
'--mirror=[URL for tools download mirror to be used instead of github.com]:MIRROR:_default' \
'--idf-mirror=[URL for ESP-IDF download mirror to be used instead of github.com]:IDF_MIRROR:_default' \
'--pypi-mirror=[URL for PyPI mirror to be used instead of https\://pypi.org/simple]:PYPI_MIRROR:_default' \
'-l+[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--locale=[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--log-file=[file in which logs will be stored (default\: eim.log)]:LOG_FILE:_default' \
'-r+[Should the installer recurse into submodules of the ESP-IDF repository (default true) ]:RECURSE_SUBMODULES:(true false)' \
'--recurse-submodules=[Should the installer recurse into submodules of the ESP-IDF repository (default true) ]:RECURSE_SUBMODULES:(true false)' \
'-a+[Should the installer attempt to install all missing prerequisites (default false). This flag only affects Windows platforms as we do not offer prerequisites for other platforms. ]:INSTALL_ALL_PREREQUISITES:(true false)' \
'--install-all-prerequisites=[Should the installer attempt to install all missing prerequisites (default false). This flag only affects Windows platforms as we do not offer prerequisites for other platforms. ]:INSTALL_ALL_PREREQUISITES:(true false)' \
'--config-file-save-path=[if set, the installer will as it'\''s very last move save the configuration to the specified file path. This file can than be used to repeat the installation with the same settings.]:CONFIG_FILE_SAVE_PATH:_default' \
'--idf-features=[Comma separated list of additional IDF features (ci, docs, pytests, etc.) to be installed with ESP-IDF.]:IDF_FEATURES:_default' \
'--idf-tools=[Comma separated list of tools to be installed with ESP-IDF.]:IDF_TOOLS:_default' \
'--repo-stub=[Repo stub to be used in case you want to use a custom repository. This is the '\''espressif/esp-idf'\'' part of the repository URL.]:REPO_STUB:_default' \
'--skip-prerequisites-check=[Skip prerequisites check. This is useful if you are sure that all prerequisites are already installed and you want to skip the check. This is not recommended unless you know what you are doing, as it can result in a non-functional installation. Use at your own risk.]:SKIP_PREREQUISITES_CHECK:(true false)' \
'--version-name=[Version name to be used for the installation. If not provided, the version will be derived from the ESP-IDF repository tag or commit hash.]:VERSION_NAME:_default' \
'--cleanup=[If set to true, the installer will remove temporary files after installation. Default is false.]:CLEANUP:(true false)' \
'--python-env-folder-name=[Folder name to be used for the python environments. If not provided, it will default to \`python\`.]:PYTHON_ENV_FOLDER_NAME:_default' \
'--use-local-archive=[Path to a local archive for offline installation. This is useful if you have already downloaded the ESP-IDF zst archive and want to use it for installation without downloading it again.]:USE_LOCAL_ARCHIVE:_files' \
'--activation-script-path-override=[Optional override for activation script path. This allows specifying a custom path for the activation script to be saved to instead of the default one.]:ACTIVATION_SCRIPT_PATH_OVERRIDE:_default' \
'--python-version-override=[Optional override for Python version to install when installing prerequisites. This allows specifying a custom Python version instead of the default one. the accepted format is without dots like '\''python313'\'' for Python 3.13]:PYTHON_VERSION_OVERRIDE:_default' \
'--create-bat-activation-script=[Whether to create a .bat activation script on Windows. This is useful for users who want to activate the ESP-IDF environment using a batch file instead of PowerShell. Default is false. This is for legacy compatibility reasons as the default activation method on Windows is now PowerShell script.]:CREATE_BAT_ACTIVATION_SCRIPT:(true false)' \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(list-tools)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'--outdated[Show only tools whose installed version is older than the latest available in tools.json]' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
'::identifier -- ID, name or path of the IDF installation:_default' \
&& ret=0
;;
(list-features)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
'::identifier -- ID, name or path of the IDF installation:_default' \
&& ret=0
;;
(select)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
'::version -- Version to select as active:_default' \
&& ret=0
;;
(discover)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
'::version -- Version to remove:_default' \
&& ret=0
;;
(rename)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
'::version -- Version to rename:_default' \
'::new_name:_default' \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
':command -- Command to run:_default' \
'::idf -- ID, name or version of idf to run:_default' \
&& ret=0
;;
(import)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
'::path -- Import using existing config file:_default' \
&& ret=0
;;
(purge)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(wizard)
_arguments "${_arguments_options[@]}" : \
'-p+[Base Path to which all the files and folder will be installed. For the \`fix\` command, this is the path of the existing installation to fix.]:PATH:_default' \
'--path=[Base Path to which all the files and folder will be installed. For the \`fix\` command, this is the path of the existing installation to fix.]:PATH:_default' \
'-c+[]:FILE:_files' \
'--config=[]:FILE:_files' \
'-t+[You can provide multiple targets separated by comma]:TARGET:_default' \
'--target=[You can provide multiple targets separated by comma]:TARGET:_default' \
'-i+[you can provide multiple versions of ESP-IDF separated by comma, you can also specify exact commit hash]:IDF_VERSIONS:_default' \
'--idf-versions=[you can provide multiple versions of ESP-IDF separated by comma, you can also specify exact commit hash]:IDF_VERSIONS:_default' \
'--tool-download-folder-name=[]:TOOL_DOWNLOAD_FOLDER_NAME:_default' \
'--tool-install-folder-name=[]:TOOL_INSTALL_FOLDER_NAME:_default' \
'--tools-json-file=[Path to tools.json file relative from ESP-IDF installation folder]:TOOLS_JSON_FILE:_default' \
'-n+[]:NON_INTERACTIVE:(true false)' \
'--non-interactive=[]:NON_INTERACTIVE:(true false)' \
'-m+[URL for tools download mirror to be used instead of github.com]:MIRROR:_default' \
'--mirror=[URL for tools download mirror to be used instead of github.com]:MIRROR:_default' \
'--idf-mirror=[URL for ESP-IDF download mirror to be used instead of github.com]:IDF_MIRROR:_default' \
'--pypi-mirror=[URL for PyPI mirror to be used instead of https\://pypi.org/simple]:PYPI_MIRROR:_default' \
'-l+[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--locale=[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--log-file=[file in which logs will be stored (default\: eim.log)]:LOG_FILE:_default' \
'-r+[Should the installer recurse into submodules of the ESP-IDF repository (default true) ]:RECURSE_SUBMODULES:(true false)' \
'--recurse-submodules=[Should the installer recurse into submodules of the ESP-IDF repository (default true) ]:RECURSE_SUBMODULES:(true false)' \
'-a+[Should the installer attempt to install all missing prerequisites (default false). This flag only affects Windows platforms as we do not offer prerequisites for other platforms. ]:INSTALL_ALL_PREREQUISITES:(true false)' \
'--install-all-prerequisites=[Should the installer attempt to install all missing prerequisites (default false). This flag only affects Windows platforms as we do not offer prerequisites for other platforms. ]:INSTALL_ALL_PREREQUISITES:(true false)' \
'--config-file-save-path=[if set, the installer will as it'\''s very last move save the configuration to the specified file path. This file can than be used to repeat the installation with the same settings.]:CONFIG_FILE_SAVE_PATH:_default' \
'--idf-features=[Comma separated list of additional IDF features (ci, docs, pytests, etc.) to be installed with ESP-IDF.]:IDF_FEATURES:_default' \
'--idf-tools=[Comma separated list of tools to be installed with ESP-IDF.]:IDF_TOOLS:_default' \
'--repo-stub=[Repo stub to be used in case you want to use a custom repository. This is the '\''espressif/esp-idf'\'' part of the repository URL.]:REPO_STUB:_default' \
'--skip-prerequisites-check=[Skip prerequisites check. This is useful if you are sure that all prerequisites are already installed and you want to skip the check. This is not recommended unless you know what you are doing, as it can result in a non-functional installation. Use at your own risk.]:SKIP_PREREQUISITES_CHECK:(true false)' \
'--version-name=[Version name to be used for the installation. If not provided, the version will be derived from the ESP-IDF repository tag or commit hash.]:VERSION_NAME:_default' \
'--cleanup=[If set to true, the installer will remove temporary files after installation. Default is false.]:CLEANUP:(true false)' \
'--python-env-folder-name=[Folder name to be used for the python environments. If not provided, it will default to \`python\`.]:PYTHON_ENV_FOLDER_NAME:_default' \
'--use-local-archive=[Path to a local archive for offline installation. This is useful if you have already downloaded the ESP-IDF zst archive and want to use it for installation without downloading it again.]:USE_LOCAL_ARCHIVE:_files' \
'--activation-script-path-override=[Optional override for activation script path. This allows specifying a custom path for the activation script to be saved to instead of the default one.]:ACTIVATION_SCRIPT_PATH_OVERRIDE:_default' \
'--python-version-override=[Optional override for Python version to install when installing prerequisites. This allows specifying a custom Python version instead of the default one. the accepted format is without dots like '\''python313'\'' for Python 3.13]:PYTHON_VERSION_OVERRIDE:_default' \
'--create-bat-activation-script=[Whether to create a .bat activation script on Windows. This is useful for users who want to activate the ESP-IDF environment using a batch file instead of PowerShell. Default is false. This is for legacy compatibility reasons as the default activation method on Windows is now PowerShell script.]:CREATE_BAT_ACTIVATION_SCRIPT:(true false)' \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(fix)
_arguments "${_arguments_options[@]}" : \
'-p+[Base Path to which all the files and folder will be installed. For the \`fix\` command, this is the path of the existing installation to fix.]:PATH:_default' \
'--path=[Base Path to which all the files and folder will be installed. For the \`fix\` command, this is the path of the existing installation to fix.]:PATH:_default' \
'-c+[]:FILE:_files' \
'--config=[]:FILE:_files' \
'-t+[You can provide multiple targets separated by comma]:TARGET:_default' \
'--target=[You can provide multiple targets separated by comma]:TARGET:_default' \
'-i+[you can provide multiple versions of ESP-IDF separated by comma, you can also specify exact commit hash]:IDF_VERSIONS:_default' \
'--idf-versions=[you can provide multiple versions of ESP-IDF separated by comma, you can also specify exact commit hash]:IDF_VERSIONS:_default' \
'--tool-download-folder-name=[]:TOOL_DOWNLOAD_FOLDER_NAME:_default' \
'--tool-install-folder-name=[]:TOOL_INSTALL_FOLDER_NAME:_default' \
'--tools-json-file=[Path to tools.json file relative from ESP-IDF installation folder]:TOOLS_JSON_FILE:_default' \
'-n+[]:NON_INTERACTIVE:(true false)' \
'--non-interactive=[]:NON_INTERACTIVE:(true false)' \
'-m+[URL for tools download mirror to be used instead of github.com]:MIRROR:_default' \
'--mirror=[URL for tools download mirror to be used instead of github.com]:MIRROR:_default' \
'--idf-mirror=[URL for ESP-IDF download mirror to be used instead of github.com]:IDF_MIRROR:_default' \
'--pypi-mirror=[URL for PyPI mirror to be used instead of https\://pypi.org/simple]:PYPI_MIRROR:_default' \
'-l+[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--locale=[Set the language for the wizard (en, cn)]:LOCALE:_default' \
'--log-file=[file in which logs will be stored (default\: eim.log)]:LOG_FILE:_default' \
'-r+[Should the installer recurse into submodules of the ESP-IDF repository (default true) ]:RECURSE_SUBMODULES:(true false)' \
'--recurse-submodules=[Should the installer recurse into submodules of the ESP-IDF repository (default true) ]:RECURSE_SUBMODULES:(true false)' \
'-a+[Should the installer attempt to install all missing prerequisites (default false). This flag only affects Windows platforms as we do not offer prerequisites for other platforms. ]:INSTALL_ALL_PREREQUISITES:(true false)' \
'--install-all-prerequisites=[Should the installer attempt to install all missing prerequisites (default false). This flag only affects Windows platforms as we do not offer prerequisites for other platforms. ]:INSTALL_ALL_PREREQUISITES:(true false)' \
'--config-file-save-path=[if set, the installer will as it'\''s very last move save the configuration to the specified file path. This file can than be used to repeat the installation with the same settings.]:CONFIG_FILE_SAVE_PATH:_default' \
'--idf-features=[Comma separated list of additional IDF features (ci, docs, pytests, etc.) to be installed with ESP-IDF.]:IDF_FEATURES:_default' \
'--idf-tools=[Comma separated list of tools to be installed with ESP-IDF.]:IDF_TOOLS:_default' \
'--repo-stub=[Repo stub to be used in case you want to use a custom repository. This is the '\''espressif/esp-idf'\'' part of the repository URL.]:REPO_STUB:_default' \
'--skip-prerequisites-check=[Skip prerequisites check. This is useful if you are sure that all prerequisites are already installed and you want to skip the check. This is not recommended unless you know what you are doing, as it can result in a non-functional installation. Use at your own risk.]:SKIP_PREREQUISITES_CHECK:(true false)' \
'--version-name=[Version name to be used for the installation. If not provided, the version will be derived from the ESP-IDF repository tag or commit hash.]:VERSION_NAME:_default' \
'--cleanup=[If set to true, the installer will remove temporary files after installation. Default is false.]:CLEANUP:(true false)' \
'--python-env-folder-name=[Folder name to be used for the python environments. If not provided, it will default to \`python\`.]:PYTHON_ENV_FOLDER_NAME:_default' \
'--use-local-archive=[Path to a local archive for offline installation. This is useful if you have already downloaded the ESP-IDF zst archive and want to use it for installation without downloading it again.]:USE_LOCAL_ARCHIVE:_files' \
'--activation-script-path-override=[Optional override for activation script path. This allows specifying a custom path for the activation script to be saved to instead of the default one.]:ACTIVATION_SCRIPT_PATH_OVERRIDE:_default' \
'--python-version-override=[Optional override for Python version to install when installing prerequisites. This allows specifying a custom Python version instead of the default one. the accepted format is without dots like '\''python313'\'' for Python 3.13]:PYTHON_VERSION_OVERRIDE:_default' \
'--create-bat-activation-script=[Whether to create a .bat activation script on Windows. This is useful for users who want to activate the ESP-IDF environment using a batch file instead of PowerShell. Default is false. This is for legacy compatibility reasons as the default activation method on Windows is now PowerShell script.]:CREATE_BAT_ACTIVATION_SCRIPT:(true false)' \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(install-drivers)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
':shell -- Shell for which to generate completion.:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help-json)
_arguments "${_arguments_options[@]}" : \
'--do-not-track=[If set to true, the installer will not send any usage data. Default is false.]:DO_NOT_TRACK:(true false)' \
'--esp-idf-json-path=[Path to directory for eim_idf.json. During install, the configuration file is saved here. For version management commands (list, select, rename, remove, etc.), it specifies where to read the file. Defaults to ~/.espressif/tools on POSIX, C\:\\Espressif\\tools on Windows.]:ESP_IDF_JSON_PATH:_default' \
'*-v[Increase verbosity level (can be used multiple times)]' \
'*--verbose[Increase verbosity level (can be used multiple times)]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_eim__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:eim-help-command-$line[1]:"
        case $line[1] in
            (install)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list-tools)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list-features)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(select)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(discover)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(rename)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(import)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(purge)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(wizard)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fix)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(install-drivers)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help-json)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_eim_commands] )) ||
_eim_commands() {
    local commands; commands=(
'install:Install ESP-IDF versions' \
'list:List installed ESP-IDF versions' \
'list-tools:List tools declared in an installed ESP-IDF'\''s tools.json, with on-disk status' \
'list-features:List features declared in an installed ESP-IDF'\''s requirements.json, with install status' \
'select:Select an ESP-IDF version as active' \
'discover:Discover available ESP-IDF versions (not implemented yet)' \
'remove:Remove specific ESP-IDF version' \
'rename:Rename specific ESP-IDF version' \
'run:Run command in the context of a specific ESP-IDF version' \
'import:Import existing ESP-IDF installation using tools_set_config.json' \
'purge:Purge all ESP-IDF installations' \
'wizard:Run the ESP-IDF Installer Wizard' \
'fix:Fix the ESP-IDF installation by reinstalling the tools and dependencies' \
'install-drivers:Install drivers for ESP-IDF. This is only available on Windows platforms' \
'completions:Generate shell completion script to stdout' \
'help-json:Print help in JSON format for machine reading' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'eim commands' commands "$@"
}
(( $+functions[_eim__subcmd__completions_commands] )) ||
_eim__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'eim completions commands' commands "$@"
}
(( $+functions[_eim__subcmd__discover_commands] )) ||
_eim__subcmd__discover_commands() {
    local commands; commands=()
    _describe -t commands 'eim discover commands' commands "$@"
}
(( $+functions[_eim__subcmd__fix_commands] )) ||
_eim__subcmd__fix_commands() {
    local commands; commands=()
    _describe -t commands 'eim fix commands' commands "$@"
}
(( $+functions[_eim__subcmd__help_commands] )) ||
_eim__subcmd__help_commands() {
    local commands; commands=(
'install:Install ESP-IDF versions' \
'list:List installed ESP-IDF versions' \
'list-tools:List tools declared in an installed ESP-IDF'\''s tools.json, with on-disk status' \
'list-features:List features declared in an installed ESP-IDF'\''s requirements.json, with install status' \
'select:Select an ESP-IDF version as active' \
'discover:Discover available ESP-IDF versions (not implemented yet)' \
'remove:Remove specific ESP-IDF version' \
'rename:Rename specific ESP-IDF version' \
'run:Run command in the context of a specific ESP-IDF version' \
'import:Import existing ESP-IDF installation using tools_set_config.json' \
'purge:Purge all ESP-IDF installations' \
'wizard:Run the ESP-IDF Installer Wizard' \
'fix:Fix the ESP-IDF installation by reinstalling the tools and dependencies' \
'install-drivers:Install drivers for ESP-IDF. This is only available on Windows platforms' \
'completions:Generate shell completion script to stdout' \
'help-json:Print help in JSON format for machine reading' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'eim help commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__completions_commands] )) ||
_eim__subcmd__help__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'eim help completions commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__discover_commands] )) ||
_eim__subcmd__help__subcmd__discover_commands() {
    local commands; commands=()
    _describe -t commands 'eim help discover commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__fix_commands] )) ||
_eim__subcmd__help__subcmd__fix_commands() {
    local commands; commands=()
    _describe -t commands 'eim help fix commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__help_commands] )) ||
_eim__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'eim help help commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__help-json_commands] )) ||
_eim__subcmd__help__subcmd__help-json_commands() {
    local commands; commands=()
    _describe -t commands 'eim help help-json commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__import_commands] )) ||
_eim__subcmd__help__subcmd__import_commands() {
    local commands; commands=()
    _describe -t commands 'eim help import commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__install_commands] )) ||
_eim__subcmd__help__subcmd__install_commands() {
    local commands; commands=()
    _describe -t commands 'eim help install commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__install-drivers_commands] )) ||
_eim__subcmd__help__subcmd__install-drivers_commands() {
    local commands; commands=()
    _describe -t commands 'eim help install-drivers commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__list_commands] )) ||
_eim__subcmd__help__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'eim help list commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__list-features_commands] )) ||
_eim__subcmd__help__subcmd__list-features_commands() {
    local commands; commands=()
    _describe -t commands 'eim help list-features commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__list-tools_commands] )) ||
_eim__subcmd__help__subcmd__list-tools_commands() {
    local commands; commands=()
    _describe -t commands 'eim help list-tools commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__purge_commands] )) ||
_eim__subcmd__help__subcmd__purge_commands() {
    local commands; commands=()
    _describe -t commands 'eim help purge commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__remove_commands] )) ||
_eim__subcmd__help__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'eim help remove commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__rename_commands] )) ||
_eim__subcmd__help__subcmd__rename_commands() {
    local commands; commands=()
    _describe -t commands 'eim help rename commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__run_commands] )) ||
_eim__subcmd__help__subcmd__run_commands() {
    local commands; commands=()
    _describe -t commands 'eim help run commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__select_commands] )) ||
_eim__subcmd__help__subcmd__select_commands() {
    local commands; commands=()
    _describe -t commands 'eim help select commands' commands "$@"
}
(( $+functions[_eim__subcmd__help__subcmd__wizard_commands] )) ||
_eim__subcmd__help__subcmd__wizard_commands() {
    local commands; commands=()
    _describe -t commands 'eim help wizard commands' commands "$@"
}
(( $+functions[_eim__subcmd__help-json_commands] )) ||
_eim__subcmd__help-json_commands() {
    local commands; commands=()
    _describe -t commands 'eim help-json commands' commands "$@"
}
(( $+functions[_eim__subcmd__import_commands] )) ||
_eim__subcmd__import_commands() {
    local commands; commands=()
    _describe -t commands 'eim import commands' commands "$@"
}
(( $+functions[_eim__subcmd__install_commands] )) ||
_eim__subcmd__install_commands() {
    local commands; commands=()
    _describe -t commands 'eim install commands' commands "$@"
}
(( $+functions[_eim__subcmd__install-drivers_commands] )) ||
_eim__subcmd__install-drivers_commands() {
    local commands; commands=()
    _describe -t commands 'eim install-drivers commands' commands "$@"
}
(( $+functions[_eim__subcmd__list_commands] )) ||
_eim__subcmd__list_commands() {
    local commands; commands=()
    _describe -t commands 'eim list commands' commands "$@"
}
(( $+functions[_eim__subcmd__list-features_commands] )) ||
_eim__subcmd__list-features_commands() {
    local commands; commands=()
    _describe -t commands 'eim list-features commands' commands "$@"
}
(( $+functions[_eim__subcmd__list-tools_commands] )) ||
_eim__subcmd__list-tools_commands() {
    local commands; commands=()
    _describe -t commands 'eim list-tools commands' commands "$@"
}
(( $+functions[_eim__subcmd__purge_commands] )) ||
_eim__subcmd__purge_commands() {
    local commands; commands=()
    _describe -t commands 'eim purge commands' commands "$@"
}
(( $+functions[_eim__subcmd__remove_commands] )) ||
_eim__subcmd__remove_commands() {
    local commands; commands=()
    _describe -t commands 'eim remove commands' commands "$@"
}
(( $+functions[_eim__subcmd__rename_commands] )) ||
_eim__subcmd__rename_commands() {
    local commands; commands=()
    _describe -t commands 'eim rename commands' commands "$@"
}
(( $+functions[_eim__subcmd__run_commands] )) ||
_eim__subcmd__run_commands() {
    local commands; commands=()
    _describe -t commands 'eim run commands' commands "$@"
}
(( $+functions[_eim__subcmd__select_commands] )) ||
_eim__subcmd__select_commands() {
    local commands; commands=()
    _describe -t commands 'eim select commands' commands "$@"
}
(( $+functions[_eim__subcmd__wizard_commands] )) ||
_eim__subcmd__wizard_commands() {
    local commands; commands=()
    _describe -t commands 'eim wizard commands' commands "$@"
}

if [ "$funcstack[1]" = "_eim" ]; then
    _eim "$@"
else
    compdef _eim eim
fi
