kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/fix-autocomplete-bash' into 'master'
Replaced broken link to shell autocompletion See merge request espressif/esp-idf!13938pull/6904/head
commit
c576c1414b
|
@ -83,9 +83,9 @@ Multiple ``idf.py`` commands can be combined into one. For example, ``idf.py -p
|
||||||
|
|
||||||
For commands that are not known to ``idf.py`` an attempt to execute them as a build system target will be made.
|
For commands that are not known to ``idf.py`` an attempt to execute them as a build system target will be made.
|
||||||
|
|
||||||
The command ``idf.py`` supports `shell autocompletion <https://click.palletsprojects.com/bashcomplete/>`_ for bash, zsh and fish shells.
|
The command ``idf.py`` supports `shell autocompletion <https://click.palletsprojects.com/shell-completion/>`_ for bash, zsh and fish shells.
|
||||||
|
|
||||||
In order to make `shell autocompletion <https://click.palletsprojects.com/bashcomplete/>`_ supported, please make sure you have at least Python 3.5 and `click <https://click.palletsprojects.com/>`_ 7.1 or newer (:ref:`see also <get-started-get-prerequisites>`).
|
In order to make `shell autocompletion <https://click.palletsprojects.com/shell-completion/>`_ supported, please make sure you have at least Python 3.5 and `click <https://click.palletsprojects.com/>`_ 7.1 or newer (:ref:`see also <get-started-get-prerequisites>`).
|
||||||
|
|
||||||
To enable autocompletion for ``idf.py`` use the ``export`` command (:ref:`see this <get-started-export>`). Autocompletion is initiated by pressing the TAB key. Type "idf.py -" and press the TAB key to autocomplete options.
|
To enable autocompletion for ``idf.py`` use the ``export`` command (:ref:`see this <get-started-export>`). Autocompletion is initiated by pressing the TAB key. Type "idf.py -" and press the TAB key to autocomplete options.
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,9 @@ idf.py
|
||||||
|
|
||||||
对于 ``idf.py`` 不知道的指令,``idf.py`` 会尝试将其作为构建系统的目标来执行。
|
对于 ``idf.py`` 不知道的指令,``idf.py`` 会尝试将其作为构建系统的目标来执行。
|
||||||
|
|
||||||
``idf.py`` 命令支持 bash、 zsh 以及 fish shell 的 `自动补全 <https://click.palletsprojects.com/bashcomplete/>`_。
|
``idf.py`` 命令支持 bash、 zsh 以及 fish shell 的 `自动补全 <https://click.palletsprojects.com/shell-completion/>`_。
|
||||||
|
|
||||||
要实现实现 shell `自动补全 <https://click.palletsprojects.com/bashcomplete/>`_,请先确保您安装了 Python 3.5 以及 `click <https://click.palletsprojects.com/>`_ 7.1 及以上版本(:ref:`请参考这里 <get-started-get-prerequisites>`)。
|
要实现实现 shell `自动补全 <https://click.palletsprojects.com/shell-completion/>`_,请先确保您安装了 Python 3.5 以及 `click <https://click.palletsprojects.com/>`_ 7.1 及以上版本(:ref:`请参考这里 <get-started-get-prerequisites>`)。
|
||||||
|
|
||||||
使用 ``export`` 命令来启用 ``idf.py`` 的自动补全功能(:ref:`请参考这里 <get-started-export>`)。按 TAB 键可实现自动补全。输入 “idf.py -” 后按 TAB 键可自动补全选项。
|
使用 ``export`` 命令来启用 ``idf.py`` 的自动补全功能(:ref:`请参考这里 <get-started-export>`)。按 TAB 键可实现自动补全。输入 “idf.py -” 后按 TAB 键可自动补全选项。
|
||||||
|
|
||||||
|
|
|
@ -153,10 +153,10 @@ enable_autocomplete() {
|
||||||
if [ -n "${ZSH_VERSION-}" ]
|
if [ -n "${ZSH_VERSION-}" ]
|
||||||
then
|
then
|
||||||
autoload -Uz compinit && compinit -u
|
autoload -Uz compinit && compinit -u
|
||||||
eval "$(env _IDF.PY_COMPLETE=$SOURCE_ZSH idf.py)" || echo "WARNING: Failed to load shell autocompletion!"
|
eval "$(env _IDF.PY_COMPLETE=$SOURCE_ZSH idf.py)" || echo "WARNING: Failed to load shell autocompletion for zsh version: $ZSH_VERSION!"
|
||||||
elif [ -n "${BASH_SOURCE-}" ]
|
elif [ -n "${BASH_SOURCE-}" ]
|
||||||
then
|
then
|
||||||
eval "$(env _IDF.PY_COMPLETE=$SOURCE_BASH idf.py)" || echo "WARNING: Failed to load shell autocompletion!"
|
eval "$(env _IDF.PY_COMPLETE=$SOURCE_BASH idf.py)" || echo "WARNING: Failed to load shell autocompletion for bash version: $BASH_VERSION!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset SOURCE_ZSH
|
unset SOURCE_ZSH
|
||||||
|
|
Ładowanie…
Reference in New Issue