fix: compile command logic when using id-as ice (#619)

- Updated README.md `compiling` section
- Compile commands now work with `id-as` ice
- Compile command options added to tab completion  

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
vladislav doster 2024-03-03 23:43:48 -06:00 committed by GitHub
parent 6511ca7fe3
commit b7b8347cad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 331 additions and 5622 deletions

View file

@ -53,7 +53,8 @@ jobs:
m4 \
ninja-build \
pkg-config \
xz-utils
xz-utils \
zsh
- name: "install dependencies"
id: install-deps
@ -63,10 +64,11 @@ jobs:
- name: "install zunit"
id: install-zunit
shell: zsh {0}
run: |
mkdir -p "$HOME/.local/bin" && echo "$HOME/.local/bin" >> $GITHUB_PATH
git clone --depth 1 https://github.com/zdharma-continuum/zunit; cd ./zunit
zsh -l -c './build.zsh' && sudo chmod u+x ./zunit && cp ./zunit "$HOME/.local/bin/"
./configure --prefix=$HOME/.local && make all install
- name: "annexes"
run: zunit run tests/annexes.zunit
@ -74,6 +76,9 @@ jobs:
- name: "commands"
run: zunit run tests/commands.zunit
- name: "compile"
run: zunit run tests/compile.zunit
- name: "gh-r"
run: zunit run tests/gh-r.zunit

View file

@ -3,5 +3,5 @@ directories:
output: tests/_output
support: tests/_support
tests: tests
fail_fast: false
fail_fast: true
verbose: true

View file

@ -9,7 +9,7 @@ # Zinit<a name="zinit"></a>
[![MIT License][mit-badge]][mit-link] [![zinit version][ver-badge]][ver-link] [![zunit tests][tests-badge]][tests-link]
[![Join the chat at https://gitter.im/zdharma-continuum/zinit][gitter-badge]][gitter-link]
<!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=2 -->
<!-- mdformat-toc start --slug=github --maxlevel=3 --minlevel=2 -->
- [Zinit Wiki](#zinit-wiki)
- [Install](#install)
@ -853,11 +853,41 @@ ### Reports and Statistics<a name="reports-and-statistics"></a>
### Compiling<a name="compiling"></a>
| Command | Description |
| ---------------------- | ------------------------------------------------------------------- |
| `compiled` | List plugins that are compiled. |
| `compile {plg-spec}` | Compile plugin. `--all` compile all plugins. |
| `uncompile {plg-spec}` | Remove compiled version of plugin. `--all` do it for all plugins. |
#### compile<a name="compile"></a>
List plugins that are compiled.
```zsh
zinit [options] compile PLUGIN
```
| Option | Description |
| ------------- | ------------------------- |
| `-a, --all` | Compile all plugins |
| `-h, --help` | Print usage |
| `-q, --quiet` | Suppress the build output |
#### compiled<a name="compiled"></a>
List plugins that are compiled.
```zsh
zinit compiled
```
#### uncompile<a name="uncompile"></a>
List plugins that are compiled.
```zsh
zinit [options] uncompile PLUGIN
```
| Option | Description |
| ------------- | ----------------------------------------- |
| `-a, --all` | Remove any compiled files for all plugins |
| `-h, --help` | Print usage |
| `-q, --quiet` | Suppress the output |
### Other<a name="other"></a>

18
_zinit
View file

@ -178,9 +178,12 @@ _zinit_completions(){
# FUNCTION: _zinit_create [[[
_zinit_compile(){
_arguments \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Make some output more quiet]' \
+ '(operation)' \
'1:installed:__zinit_installed' \
{-a,--all}'[Compile all plugins]'
'(-a --all)'{-a,--all}'[Compile all plugins]' \
'*::installed:__zinit_installed' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_create [[[
_zinit_create(){
@ -299,10 +302,13 @@ _zinit_times(){
} # ]]]
# FUNCTION: _zinit_uncompile [[[
_zinit_uncompile(){
_arguments -A \
'(-a --all)'{-a,--all}'[Delete all plugins and snippets]'
_arguments - installed '*::installed:__zinit_installed' && ret=0
# - plugin '1:plugin:__zinit_installed_plugins'
_arguments \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Make some output more quiet]' \
+ '(operation)' \
'(-a --all)'{-a,--all}'[Uncompile all plugins]' \
'*::installed:__zinit_installed' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_unload [[[
_zinit_unload(){

View file

@ -1,451 +0,0 @@
_zinit(1)
=========
:compat-mode!:
NAME
----
_zinit - a shell script
SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
__zinit_commands
__zinit_completion_caching_policy
__zinit_installed
__zinit_installed_plugins
__zinit_installed_snippets
__zinit_list_aliases
_zinit
_zinit_add_fpath
_zinit_bindkeys
_zinit_cclear
_zinit_cd
_zinit_cdclear
_zinit_cdisable
_zinit_cdlist
_zinit_cdreplay
_zinit_cenable
_zinit_changes
_zinit_clist
_zinit_compile
_zinit_compiled
_zinit_compinit
_zinit_completions
_zinit_create
_zinit_creinstall
_zinit_csearch
_zinit_cunistall
_zinit_dclear
_zinit_delete
_zinit_dreport
_zinit_dstart
_zinit_dstop
_zinit_dtrace
_zinit_dunload
_zinit_edit
_zinit_env_whitelist
_zinit_glance
_zinit_list
_zinit_load
_zinit_loaded
_zinit_man
_zinit_module
_zinit_recall
_zinit_recently
_zinit_report
_zinit_run
_zinit_snippet
_zinit_status
_zinit_stress
_zinit_times
_zinit_uncompile
_zinit_unload
_zinit_update
DETAILS
-------
Script Body
~~~~~~~~~~~
Has 3 line(s). Calls functions:
Script-Body
`-- _zinit
`-- __zinit_commands
__zinit_commands
~~~~~~~~~~~~~~~~
Has 55 line(s). Doesn't call other functions.
Called by:
_zinit
__zinit_completion_caching_policy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Has 4 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
__zinit_installed
~~~~~~~~~~~~~~~~~
Has 3 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
__zinit_installed_plugins
~~~~~~~~~~~~~~~~~~~~~~~~~
Has 8 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
__zinit_installed_snippets
~~~~~~~~~~~~~~~~~~~~~~~~~~
Has 6 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
__zinit_list_aliases
~~~~~~~~~~~~~~~~~~~~
Has 3 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit
~~~~~~
Has 23 line(s). Calls functions:
_zinit
`-- __zinit_commands
Called by:
Script-Body
_zinit_add_fpath
~~~~~~~~~~~~~~~~
Has 2 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_bindkeys
~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cclear
~~~~~~~~~~~~~
Has 4 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cd
~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cdclear
~~~~~~~~~~~~~~
Has 4 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cdisable
~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cdlist
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cdreplay
~~~~~~~~~~~~~~~
Has 4 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cenable
~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_changes
~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_clist
~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_compile
~~~~~~~~~~~~~~
Has 3 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_compiled
~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_compinit
~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_completions
~~~~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_create
~~~~~~~~~~~~~
Has 2 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_creinstall
~~~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_csearch
~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_cunistall
~~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_dclear
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_delete
~~~~~~~~~~~~~
Has 8 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_dreport
~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_dstart
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_dstop
~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_dtrace
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_dunload
~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_edit
~~~~~~~~~~~
Has 3 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_env_whitelist
~~~~~~~~~~~~~~~~~~~~
Has 4 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_glance
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_list
~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_load
~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_loaded
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_man
~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_module
~~~~~~~~~~~~~
Has 2 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_recall
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_recently
~~~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_report
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_run
~~~~~~~~~~
Has 3 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_snippet
~~~~~~~~~~~~~~
Has 5 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_status
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_stress
~~~~~~~~~~~~~
Has 1 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_times
~~~~~~~~~~~~
Has 6 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_uncompile
~~~~~~~~~~~~~~~~
Has 3 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_unload
~~~~~~~~~~~~~
Has 4 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
_zinit_update
~~~~~~~~~~~~~
Has 10 line(s). Doesn't call other functions.
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).

View file

@ -1,185 +0,0 @@
NAME
zinit-additional.zsh - a shell script
Documentation automatically generated with `zshelldoc'
== FUNCTIONS
+zinit-debug
.zinit-debug-clear
.zinit-debug-report
.zinit-debug-revert
.zinit-debug-start
.zinit-debug-status
.zinit-debug-stop
.zinit-service
.zinit-wrap-track-functions
:zinit-tmp-subst-source
=== DETAILS
==== Script Body
Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
==== +zinit-debug
____
Debug command entry point
____
Has 35 line(s). Doesn't call other functions.
Uses feature(s): _setopt_, _zmodload_, _zparseopts_
Called by:
zinit.zsh/zinit
==== .zinit-debug-clear
____
Clear latest debug report
____
Has 7 line(s). Calls functions:
.zinit-debug-clear
|-- zinit-autoload.zsh/.zinit-clear-report-for
`-- zinit.zsh/+zi-log
Called by:
zinit-autoload.zsh/.zinit-unload
==== .zinit-debug-report
____
Displays debug report (data recorded in interactive session).
____
Has 6 line(s). Calls functions:
.zinit-debug-report
|-- zinit-autoload.zsh/.zinit-show-report
`-- zinit.zsh/+zi-log
Uses feature(s): _source_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-debug-revert
____
Revert changes made during debug mode
____
Has 7 line(s). Calls functions:
.zinit-debug-revert
|-- zinit-autoload.zsh/.zinit-unload
`-- zinit.zsh/+zi-log
Uses feature(s): _source_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-debug-start
____
Start debug mode
____
Has 13 line(s). Calls functions:
.zinit-debug-start
|-- zinit.zsh/+zi-log
|-- zinit.zsh/.zinit-diff
`-- zinit.zsh/.zinit-tmp-subst-on
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-debug-status
____
Revert changes made during debug mode
____
Has 2 line(s). Calls functions:
.zinit-debug-status
`-- zinit.zsh/+zi-log
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-debug-stop
____
Stop debug mode
____
Has 14 line(s). Calls functions:
.zinit-debug-stop
|-- zinit.zsh/+zi-log
|-- zinit.zsh/.zinit-diff
`-- zinit.zsh/.zinit-tmp-subst-off
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-service
____
Handles given service, i.e. obtains lock, runs it, or waits if no lock
$1 - type "p" or "s" (plugin or snippet)
$2 - mode - for plugin (light or load)
$3 - id - URL or plugin ID or alias name (from id-as'')
____
Has 37 line(s). Calls functions:
.zinit-service
|-- zinit.zsh/.zinit-load
`-- zinit.zsh/.zinit-load-snippet
Uses feature(s): _kill_, _read_, _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-wrap-track-functions
Has 19 line(s). Doesn't call other functions.
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== :zinit-tmp-subst-source
Has 25 line(s). Calls functions:
:zinit-tmp-subst-source
`-- zinit.zsh/+zi-log
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).

File diff suppressed because it is too large Load diff

View file

@ -1,847 +0,0 @@
NAME
zinit-install.zsh - a shell script
Documentation automatically generated with `zshelldoc'
== FUNCTIONS
.zi::get-architecture
.zinit-at-eval
.zinit-compile-plugin
.zinit-compinit
.zinit-configure-run-autoconf
.zinit-download-file-stdout
.zinit-download-snippet
.zinit-extract
.zinit-forget-completion
.zinit-get-cygwin-package
.zinit-get-latest-gh-r-url-part
.zinit-get-package
.zinit-get-url-mtime
.zinit-install-completions
.zinit-jq-check
.zinit-json-get-value
.zinit-json-to-array
.zinit-mirror-using-svn
.zinit-setup-plugin-dir
.zinit-single-line
.zinit-update-snippet
zicp
ziextract
zimv
∞zinit-atclone-hook
∞zinit-atpull-e-hook
∞zinit-atpull-hook
∞zinit-compile-plugin-hook
∞zinit-configure-base-hook
∞zinit-configure-e-hook
∞zinit-configure-hook
∞zinit-cp-hook
∞zinit-extract-hook
∞zinit-make-base-hook
∞zinit-make-e-hook
∞zinit-make-ee-hook
∞zinit-make-hook
∞zinit-mv-hook
∞zinit-ps-on-update-hook
∞zinit-reset-hook
AUTOLOAD compinit
=== DETAILS
==== Script Body
Has 6 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
Uses feature(s): _source_
==== .zi::get-architecture
Has 39 line(s). Calls functions:
.zi::get-architecture
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-at-eval
Has 9 line(s). Calls functions:
.zinit-at-eval
`-- zinit.zsh/@zinit-substitute
Uses feature(s): _eval_
Called by:
∞zinit-atpull-e-hook
∞zinit-atpull-hook
==== .zinit-compile-plugin
____
Compiles given plugin (its main source file, and also an
additional "....zsh" file if it exists).
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given)
____
Has 89 line(s). Calls functions:
.zinit-compile-plugin
|-- zinit-side.zsh/.zinit-compute-ice
|-- zinit-side.zsh/.zinit-first
`-- zinit.zsh/+zi-log
Uses feature(s): _eval_, _setopt_, _zcompile_
Called by:
∞zinit-compile-plugin-hook
zinit-autoload.zsh/.zinit-compile-uncompile-all
zinit.zsh/zinit
==== .zinit-compinit
____
User-exposed `compinit' frontend which first ensures that all
completions managed by Zinit are forgotten by Zshell. After
that it runs normal `compinit', which should more easily detect
Zinit's completions.
No arguments.
____
Has 26 line(s). Calls functions:
.zinit-compinit
|-- .zinit-forget-completion
|-- compinit
`-- zinit.zsh/+zi-log
Uses feature(s): _autoload_, _compinit_, _setopt_, _unfunction_
Called by:
.zinit-install-completions
zinit-autoload.zsh/.zinit-uninstall-completions
zinit-autoload.zsh/.zinit-update-or-status-all
zinit.zsh/.zinit-prepare-home
zinit.zsh/zinit
==== .zinit-configure-run-autoconf
____
Called if # passed to configure ice or no ./configure found
Runs autoconf, autoreconf, and autogen.sh
____
Has 64 line(s). Calls functions:
.zinit-configure-run-autoconf
`-- zinit-side.zsh/.zinit-countdown
Called by:
∞zinit-configure-base-hook
==== .zinit-download-file-stdout
____
Downloads file to stdout. Supports following backend commands:
curl, wget, lftp, lynx. Used by snippet loading.
____
Has 53 line(s). Calls functions:
.zinit-download-file-stdout
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_, _trap_, _type_
Called by:
.zinit-download-snippet
.zinit-get-cygwin-package
.zinit-get-package
.zinit-setup-plugin-dir
==== .zinit-download-snippet
____
Downloads snippet
file with curl, wget, lftp or lynx,
directory, with Subversion when svn-ICE is active.
Github supports Subversion protocol and allows to clone subdirectories.
This is used to provide a layer of support for Oh-My-Zsh and Prezto.
____
Has 377 line(s). Calls functions:
.zinit-download-snippet
|-- .zinit-download-file-stdout
|   `-- zinit.zsh/+zi-log
|-- .zinit-get-url-mtime
|-- .zinit-install-completions
|   |-- .zinit-compinit
|   |   |-- .zinit-forget-completion
|   |   |-- compinit
|   |   `-- zinit.zsh/+zi-log
|   |-- .zinit-forget-completion
|   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2
|   |-- zinit-side.zsh/.zinit-exists-physically-message
|   |-- zinit.zsh/+zi-log
|   `-- zinit.zsh/.zinit-any-to-user-plugin
|-- .zinit-mirror-using-svn
|-- zinit-side.zsh/.zinit-store-ices
|-- zinit.zsh/+zi-log
`-- zinit.zsh/is-at-least
Uses feature(s): _is-at-least_, _setopt_, _trap_, _zcompile_
Called by:
.zinit-update-snippet
zinit.zsh/.zinit-load-snippet
==== .zinit-extract
Has 30 line(s). Calls functions:
.zinit-extract
|-- ziextract
|   `-- zinit.zsh/+zi-log
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_
Called by:
∞zinit-extract-hook
==== .zinit-forget-completion
____
Implements alternation of Zsh state so that already initialized
completion stops being visible to Zsh.
$1 - completion function name, e.g. "_cp"; can also be "cp"
____
Has 20 line(s). Doesn't call other functions.
Uses feature(s): _setopt_, _unfunction_
Called by:
.zinit-compinit
.zinit-install-completions
zinit-autoload.zsh/.zinit-uninstall-completions
zinit.zsh/zinit
==== .zinit-get-cygwin-package
Has 70 line(s). Calls functions:
.zinit-get-cygwin-package
|-- .zinit-download-file-stdout
|   `-- zinit.zsh/+zi-log
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_
Called by:
.zinit-setup-plugin-dir
==== .zinit-get-latest-gh-r-url-part
____
Gets version string of latest release of given Github
package. Connects to Github releases page.
____
Has 57 line(s). Calls functions:
.zinit-get-latest-gh-r-url-part
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_
Called by:
.zinit-setup-plugin-dir
zinit-autoload.zsh/.zinit-update-or-status
==== .zinit-get-package
Has 195 line(s). Calls functions:
.zinit-get-package
|-- .zinit-download-file-stdout
|   `-- zinit.zsh/+zi-log
|-- .zinit-jq-check
|   `-- zinit.zsh/+zi-log
|-- .zinit-json-to-array
|   `-- .zinit-jq-check
|   `-- zinit.zsh/+zi-log
|-- ziextract
|   `-- zinit.zsh/+zi-log
|-- zinit.zsh/+zi-log
`-- zinit.zsh/@zinit-substitute
Uses feature(s): _eval_, _setopt_, _trap_
Called by:
zinit.zsh/.zinit-load
==== .zinit-get-url-mtime
____
For the given URL returns the date in the Last-Modified
header as a time stamp
____
Has 35 line(s). Doesn't call other functions.
Uses feature(s): _read_, _setopt_, _trap_, _type_
Called by:
.zinit-download-snippet
==== .zinit-install-completions
____
Installs all completions of given plugin. After that they are visible to
'compinit'. Visible completions can be selectively disabled and enabled. User
can access completion data with 'completions' subcommand.
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin if $1 (i.e., user) given
$3 - if 1, then reinstall, otherwise only install completions that are not present
____
Has 62 line(s). Calls functions:
.zinit-install-completions
|-- .zinit-compinit
|   |-- .zinit-forget-completion
|   |-- compinit
|   `-- zinit.zsh/+zi-log
|-- .zinit-forget-completion
|-- zinit-side.zsh/.zinit-any-colorify-as-uspl2
|-- zinit-side.zsh/.zinit-exists-physically-message
|-- zinit.zsh/+zi-log
`-- zinit.zsh/.zinit-any-to-user-plugin
Uses feature(s): _setopt_
Called by:
.zinit-download-snippet
.zinit-setup-plugin-dir
zinit.zsh/zinit
==== .zinit-jq-check
____
Check if jq is available and outputs an error message with instructions if
that's not the case
____
Has 8 line(s). Calls functions:
.zinit-jq-check
`-- zinit.zsh/+zi-log
Called by:
.zinit-get-package
.zinit-json-get-value
.zinit-json-to-array
==== .zinit-json-get-value
____
Wrapper around jq that return the value of a property
$1: JSON structure
$2: jq path
____
Has 4 line(s). Calls functions:
.zinit-json-get-value
`-- .zinit-jq-check
`-- zinit.zsh/+zi-log
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-json-to-array
____
Wrapper around jq that sets key/values of an associative array, replicating
the structure of a given JSON object
$1: JSON structure
$2: jq path
$3: name of the associative array to store the key/value pairs in
____
Has 13 line(s). Calls functions:
.zinit-json-to-array
`-- .zinit-jq-check
`-- zinit.zsh/+zi-log
Uses feature(s): _eval_, _setopt_
Called by:
.zinit-get-package
==== .zinit-mirror-using-svn
____
Used to clone subdirectories from Github. If in update mode
(see $2), then invokes `svn update', in normal mode invokes
`svn checkout --non-interactive -q <URL>'. In test mode only
compares remote and local revision and outputs true if update
is needed.
$1 - URL
$2 - mode, "" - normal, "-u" - update, "-t" - test
$3 - subdirectory (not path) with working copy, needed for -t and -u
____
Has 29 line(s). Doesn't call other functions.
Uses feature(s): _setopt_
Called by:
.zinit-download-snippet
==== .zinit-setup-plugin-dir
____
Clones given plugin into PLUGIN_DIR. Supports multiple
sites (respecting `from' and `proto' ice modifiers).
Invokes compilation of plugin's main file.
$1 - user
$2 - plugin
____
Has 214 line(s). Calls functions:
.zinit-setup-plugin-dir
|-- .zinit-download-file-stdout
|   `-- zinit.zsh/+zi-log
|-- .zinit-get-cygwin-package
|   |-- .zinit-download-file-stdout
|   |   `-- zinit.zsh/+zi-log
|   `-- zinit.zsh/+zi-log
|-- .zinit-get-latest-gh-r-url-part
|   `-- zinit.zsh/+zi-log
|-- .zinit-install-completions
|   |-- .zinit-compinit
|   |   |-- .zinit-forget-completion
|   |   |-- compinit
|   |   `-- zinit.zsh/+zi-log
|   |-- .zinit-forget-completion
|   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2
|   |-- zinit-side.zsh/.zinit-exists-physically-message
|   |-- zinit.zsh/+zi-log
|   `-- zinit.zsh/.zinit-any-to-user-plugin
|-- ziextract
|   `-- zinit.zsh/+zi-log
|-- zinit-side.zsh/.zinit-any-colorify-as-uspl2
|-- zinit-side.zsh/.zinit-store-ices
|-- zinit.zsh/+zi-log
`-- zinit.zsh/.zinit-get-object-path
Uses feature(s): _setopt_, _trap_
Called by:
zinit-autoload.zsh/.zinit-update-or-status
zinit.zsh/.zinit-load
==== .zinit-single-line
____
Display cURL progress bar on a single line
____
Has 20 line(s). Doesn't call other functions.
Uses feature(s): _read_, _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== .zinit-update-snippet
Has 76 line(s). Calls functions:
.zinit-update-snippet
|-- .zinit-download-snippet
|   |-- .zinit-download-file-stdout
|   |   `-- zinit.zsh/+zi-log
|   |-- .zinit-get-url-mtime
|   |-- .zinit-install-completions
|   |   |-- .zinit-compinit
|   |   |   |-- .zinit-forget-completion
|   |   |   |-- compinit
|   |   |   `-- zinit.zsh/+zi-log
|   |   |-- .zinit-forget-completion
|   |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2
|   |   |-- zinit-side.zsh/.zinit-exists-physically-message
|   |   |-- zinit.zsh/+zi-log
|   |   `-- zinit.zsh/.zinit-any-to-user-plugin
|   |-- .zinit-mirror-using-svn
|   |-- zinit-side.zsh/.zinit-store-ices
|   |-- zinit.zsh/+zi-log
|   `-- zinit.zsh/is-at-least
|-- zinit.zsh/+zi-log
|-- zinit.zsh/.zinit-get-object-path
`-- zinit.zsh/.zinit-pack-ice
Uses feature(s): _eval_, _setopt_
Called by:
zinit-autoload.zsh/.zinit-update-or-status-snippet
==== zicp
Has 30 line(s). Doesn't call other functions.
Uses feature(s): _setopt_
Called by:
zimv
==== ziextract
____
If the file is an archive, it is extracted by this function.
Next stage is scanning of files with the common utility file
to detect executables. They are given +x mode. There are also
messages to the user on performed actions.
$1 - url
$2 - file
____
Has 283 line(s). Calls functions:
ziextract
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_, _unfunction_, _zparseopts_
Called by:
.zinit-extract
.zinit-get-package
.zinit-setup-plugin-dir
==== zimv
Has 3 line(s). Calls functions:
zimv
`-- zicp
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-atclone-hook
Has 26 line(s). Calls functions:
∞zinit-atclone-hook
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Uses feature(s): _eval_, _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-atpull-e-hook
Has 22 line(s). Calls functions:
∞zinit-atpull-e-hook
|-- .zinit-at-eval
|   `-- zinit.zsh/@zinit-substitute
`-- zinit-side.zsh/.zinit-countdown
Uses feature(s): _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-atpull-hook
Has 22 line(s). Calls functions:
∞zinit-atpull-hook
|-- .zinit-at-eval
|   `-- zinit.zsh/@zinit-substitute
`-- zinit-side.zsh/.zinit-countdown
Uses feature(s): _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-compile-plugin-hook
Has 19 line(s). Calls functions:
∞zinit-compile-plugin-hook
`-- .zinit-compile-plugin
|-- zinit-side.zsh/.zinit-compute-ice
|-- zinit-side.zsh/.zinit-first
`-- zinit.zsh/+zi-log
Uses feature(s): _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-configure-base-hook
____
A base common implementation of configure'', as all
the starting steps are rigid and the same in all
hooks, hence the idea. TODO: use in make'' and other
places.
____
Has 65 line(s). Calls functions:
∞zinit-configure-base-hook
|-- .zinit-configure-run-autoconf
|   `-- zinit-side.zsh/.zinit-countdown
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Called by:
∞zinit-configure-e-hook
∞zinit-configure-hook
==== ∞zinit-configure-e-hook
____
The !-version of configure'' ice. Runs in between
of make'!!' and make'!'. Configure naturally runs
before make.
____
Has 1 line(s). Calls functions:
∞zinit-configure-e-hook
`-- ∞zinit-configure-base-hook
|-- .zinit-configure-run-autoconf
|   `-- zinit-side.zsh/.zinit-countdown
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-configure-hook
____
The non-! version of configure'' ice. Runs in between
of make'!' and make''. Configure script naturally runs
before make.
____
Has 1 line(s). Calls functions:
∞zinit-configure-hook
`-- ∞zinit-configure-base-hook
|-- .zinit-configure-run-autoconf
|   `-- zinit-side.zsh/.zinit-countdown
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-cp-hook
Has 30 line(s). Calls functions:
∞zinit-cp-hook
`-- zinit.zsh/@zinit-substitute
Uses feature(s): _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-extract-hook
Has 10 line(s). Calls functions:
∞zinit-extract-hook
|-- .zinit-extract
|   |-- ziextract
|   |   `-- zinit.zsh/+zi-log
|   `-- zinit.zsh/+zi-log
`-- zinit.zsh/@zinit-substitute
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-make-base-hook
Has 29 line(s). Calls functions:
∞zinit-make-base-hook
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Called by:
∞zinit-make-e-hook
∞zinit-make-ee-hook
∞zinit-make-hook
==== ∞zinit-make-e-hook
Has 1 line(s). Calls functions:
∞zinit-make-e-hook
`-- ∞zinit-make-base-hook
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-make-ee-hook
Has 1 line(s). Calls functions:
∞zinit-make-ee-hook
`-- ∞zinit-make-base-hook
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-make-hook
Has 1 line(s). Calls functions:
∞zinit-make-hook
`-- ∞zinit-make-base-hook
|-- zinit-side.zsh/.zinit-countdown
`-- zinit.zsh/@zinit-substitute
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-mv-hook
Has 35 line(s). Calls functions:
∞zinit-mv-hook
|-- zinit.zsh/+zi-log
`-- zinit.zsh/@zinit-substitute
Uses feature(s): _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-ps-on-update-hook
Has 18 line(s). Calls functions:
∞zinit-ps-on-update-hook
`-- zinit.zsh/+zi-log
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-reset-hook
Has 79 line(s). Calls functions:
∞zinit-reset-hook
`-- zinit.zsh/+zi-log
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== compinit
____
Initialisation for new style completion. This mainly contains some helper
functions and setup. Everything else is split into different files that
will automatically be made autoloaded (see the end of this file). The
names of the files that will be considered for autoloading are those that
begin with an underscores (like `_condition).
The first line of each of these files is read and must indicate what
should be done with its contents:
`#compdef <names ...>'
____
Has 573 line(s). Doesn't call other functions.
Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_
Called by:
.zinit-compinit

View file

@ -1,290 +0,0 @@
NAME
zinit-side.zsh - a shell script
Documentation automatically generated with `zshelldoc'
== FUNCTIONS
.zinit-any-colorify-as-uspl2
.zinit-compute-ice
.zinit-countdown
.zinit-exists-physically
.zinit-exists-physically-message
.zinit-first
.zinit-store-ices
.zinit-two-paths
=== DETAILS
==== Script Body
Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
==== .zinit-any-colorify-as-uspl2
____
Returns ANSI-colorified "user/plugin" string, from any supported
plugin spec (user---plugin, user/plugin, user plugin, plugin).
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given)
$REPLY - ANSI-colorified "user/plugin" string
____
Has 22 line(s). Calls functions:
.zinit-any-colorify-as-uspl2
|-- zinit.zsh/.zinit-any-to-pid
`-- zinit.zsh/.zinit-any-to-user-plugin
Called by:
.zinit-exists-physically-message
zinit-autoload.zsh/.zinit-clear-completions
zinit-autoload.zsh/.zinit-compile-uncompile-all
zinit-autoload.zsh/.zinit-compiled
zinit-autoload.zsh/.zinit-create
zinit-autoload.zsh/.zinit-exists-message
zinit-autoload.zsh/.zinit-get-completion-owner-uspl2col
zinit-autoload.zsh/.zinit-list-bindkeys
zinit-autoload.zsh/.zinit-recently
zinit-autoload.zsh/.zinit-search-completions
zinit-autoload.zsh/.zinit-show-completions
zinit-autoload.zsh/.zinit-show-times
zinit-autoload.zsh/.zinit-uncompile-plugin
zinit-autoload.zsh/.zinit-unload
zinit-autoload.zsh/.zinit-update-all-parallel
zinit-autoload.zsh/.zinit-update-or-status-all
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-install-completions
zinit-install.zsh/.zinit-setup-plugin-dir
zinit.zsh/.zinit-formatter-pid
==== .zinit-compute-ice
____
Computes ICE array
- input
- static
- saved
taking priorities into account.
Can also pack resulting ices into ZINIT_SICE (see $2).
Returns filepath to snippet directory and optional snippet file name (only
valid if ICE[svn] is not set).
$1 - URL (also plugin-spec)
$2 - "pack" or "nopack" or "pack-nf" - packing means ICE
wins with static ice; "pack-nf" means that disk-ices will
be ignored (no-file?)
$3 - name of output associative array, "ICE" is the default
$4 - name of output string parameter, to hold path to directory ("local_dir")
$5 - name of output string parameter, to hold filename ("filename")
$6 - name of output string parameter, to hold is-snippet 0/1-bool ("is_snippet")
$REPLY - snippet directory filepath
____
Has 110 line(s). Calls functions:
.zinit-compute-ice
|-- .zinit-exists-physically-message
|   |-- .zinit-any-colorify-as-uspl2
|   |   |-- zinit.zsh/.zinit-any-to-pid
|   |   `-- zinit.zsh/.zinit-any-to-user-plugin
|   |-- .zinit-exists-physically
|   |   `-- zinit.zsh/.zinit-any-to-user-plugin
|   |-- zinit.zsh/+zi-log
|   |-- zinit.zsh/.zinit-any-to-pid
|   `-- zinit.zsh/.zinit-any-to-user-plugin
|-- .zinit-two-paths
|   |-- .zinit-first
|   |   |-- zinit.zsh/.zinit-any-to-pid
|   |   |-- zinit.zsh/.zinit-any-to-user-plugin
|   |   |-- zinit.zsh/.zinit-find-other-matches
|   |   `-- zinit.zsh/.zinit-get-object-path
|   `-- zinit.zsh/.zinit-get-object-path
|-- zinit.zsh/.zinit-any-to-user-plugin
`-- zinit.zsh/.zinit-pack-ice
Uses feature(s): _setopt_
Called by:
zinit-autoload.zsh/.zinit-edit
zinit-autoload.zsh/.zinit-recall
zinit-autoload.zsh/.zinit-update-or-status-snippet
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-compile-plugin
==== .zinit-countdown
____
Displays a countdown 5...4... etc.
$REPLY - 1 if Ctrl-C is pressed, otherwise 0
____
Has 20 line(s). Calls functions:
.zinit-countdown
`-- zinit.zsh/+zi-log
Uses feature(s): _trap_
Called by:
zinit-autoload.zsh/.zinit-run-delete-hooks
zinit-install.zsh/.zinit-configure-run-autoconf
zinit-install.zsh/∞zinit-atclone-hook
zinit-install.zsh/∞zinit-atpull-e-hook
zinit-install.zsh/∞zinit-atpull-hook
zinit-install.zsh/∞zinit-configure-base-hook
zinit-install.zsh/∞zinit-make-base-hook
==== .zinit-exists-physically
____
Checks if directory of given plugin exists in PLUGIN_DIR.
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given)
____
Has 8 line(s). Calls functions:
.zinit-exists-physically
`-- zinit.zsh/.zinit-any-to-user-plugin
Called by:
.zinit-exists-physically-message
zinit-autoload.zsh/.zinit-create
zinit-autoload.zsh/.zinit-update-or-status
==== .zinit-exists-physically-message
____
Checks if directory of given plugin exists in PLUGIN_DIR, and outputs error
message if it doesn't.
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given)
____
Has 25 line(s). Calls functions:
.zinit-exists-physically-message
|-- .zinit-any-colorify-as-uspl2
|   |-- zinit.zsh/.zinit-any-to-pid
|   `-- zinit.zsh/.zinit-any-to-user-plugin
|-- .zinit-exists-physically
|   `-- zinit.zsh/.zinit-any-to-user-plugin
|-- zinit.zsh/+zi-log
|-- zinit.zsh/.zinit-any-to-pid
`-- zinit.zsh/.zinit-any-to-user-plugin
Uses feature(s): _setopt_
Called by:
.zinit-compute-ice
zinit-autoload.zsh/.zinit-changes
zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/.zinit-stress
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-install-completions
==== .zinit-first
____
Finds the main file of plugin. There are multiple file name formats, they are
ordered in order starting from more correct ones, and matched.
.zinit-load-plugin() has similar code parts and doesn't call .zinit-first()
for performance. Obscure matching is done in .zinit-find-other-matches, here
and in .zinit-load(). Obscure = non-standard main-file naming convention.
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given)
____
Has 20 line(s). Calls functions:
.zinit-first
|-- zinit.zsh/.zinit-any-to-pid
|-- zinit.zsh/.zinit-any-to-user-plugin
|-- zinit.zsh/.zinit-find-other-matches
`-- zinit.zsh/.zinit-get-object-path
Called by:
.zinit-two-paths
zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/.zinit-stress
zinit-install.zsh/.zinit-compile-plugin
==== .zinit-store-ices
____
Saves ice mods in given hash onto disk.
$1 - directory where to create or delete files
$2 - name of hash that holds values
$3 - additional keys of hash to store, space separated
$4 - additional keys of hash to store, empty-meaningful ices, space separated
$5 URL, if applicable
$6 mode, svn=1, 0=single file
____
Has 30 line(s). Doesn't call other functions.
Called by:
zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/.zinit-download-snippet
zinit-install.zsh/.zinit-setup-plugin-dir
==== .zinit-two-paths
____
Obtains a snippet URL without specification if it is an SVN URL (points to
directory) or regular URL (points to file), returns 2 possible paths for
further examination
$REPLY - two filepaths
____
Has 24 line(s). Calls functions:
.zinit-two-paths
|-- .zinit-first
|   |-- zinit.zsh/.zinit-any-to-pid
|   |-- zinit.zsh/.zinit-any-to-user-plugin
|   |-- zinit.zsh/.zinit-find-other-matches
|   `-- zinit.zsh/.zinit-get-object-path
`-- zinit.zsh/.zinit-get-object-path
Uses feature(s): _setopt_
Called by:
.zinit-compute-ice
zinit-autoload.zsh/.zinit-update-or-status

File diff suppressed because it is too large Load diff

View file

@ -11,5 +11,5 @@ is_annex() {
load_bin_gem_node(){
run zinit load @zdharma-continuum/zinit-annex-bin-gem-node
zinit default-ice --quiet from'gh-r'
zinit default-ice from'gh-r'
}

View file

@ -79,4 +79,4 @@ builtin hash -d plugins="${zi_test_dir}/plugins"
@zdharma-continuum/zinit-annex-linkman
}>/dev/null
zinit zstatus
zinit zstatus

View file

@ -1,14 +1,27 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
#
# zdharma-continuum/zinit/tests/commands.zunit
# Copyright (c) 2016-2021 Sebastian Gniazdowski
# Copyright (c) 2021-2023 zdharma-continuum
# Copyright (c) 2021-2024 zdharma-continuum
# Homepage: https://github.com/zdharma-continuum/zinit
# License: MIT License
#
@setup {
ZBIN="${ZPFX}/bin"
typeset -gx HOME="$zi_test_dir"
typeset -gx ZBIN="$zi_test_dir/polaris/bin"
}
@test 'help' {
for cmd in 'help' '-h' '--help'; do
run zinit $cmd
assert $output contains '—— help usage information'
assert $state equals 0
done
run zinit -help
assert $output contains 'Unknown subcommand'
assert $state equals 1
}
@test 'delete --help' {
@ -31,9 +44,10 @@
assert $state equals 0
}
@test 'delete a program' {
run zinit as'program' cp'wd.sh->wd' mv'_wd.sh->_wd' pick'wd' for @'mfaerevaag/wd'
run zinit delete --yes mfaerevaag/wd
run zinit as'program' cp'wd.sh->wd' mv'_wd.sh->_wd' pick'wd' completions for @'mfaerevaag/wd'
assert $state equals 0
run return ${+commands[wd]}; assert $state equals 0
run zinit delete --yes mfaerevaag/wd
}
@test 'plugins' {
@ -48,16 +62,6 @@
assert $output contains "==> 4 Plugins matching 'zdharma'"
}
@test 'help' {
for cmd in 'help' '-h' '--help'; do
run zinit $cmd
assert $output contains '—— help usage information'
assert $state equals 0
done
run zinit -help
assert $output contains 'Unknown subcommand'
assert $state equals 1
}
@test 'self-update' {
run zinit self-update
assert $output contains 'Already up-to-date.'

53
tests/compile.zunit Normal file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
@setup {
typeset -gx HOME="$zi_test_dir"
typeset -gx ZBIN="$zi_test_dir/polaris/bin"
}
@test 'compile ice - multiple files' {
run zinit for compile'h*~*zwc' id-as'hsmw-compile-ice' @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile hsmw-compile-ice)
assert $output contains "==> Compiling 4 files history-search-multi-word, history-search-multi-word.plugin.zsh, hsmw-context-main, hsmw-highlight [OK]"
assert $state equals 0
}
@test 'compile ice - single file' {
run zinit for id-as'hsmw-no-compile-ice' @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile hsmw-no-compile-ice)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
}
@test 'compile ice' {
run zinit light @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile zdharma-continuum/history-search-multi-word)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
}
@test 'compile cmd' {
run zinit for id-as"compile-command" @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile --quiet compile-command)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compiled)
assert $state equals 0
assert $output contains 'compile-command:'
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit uncompile --quiet compile-command)
assert $state equals 0; assert $output contains '==> Uncompiling compile-command [OK]'
}
@test 'compiled cmd' {
zinit uncompile --all --quiet
run zinit compiled; assert $state equals 0
assert $output contains 'No compiled plugins'
}
@test 'uncompile cmd' {
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile -q compile-command)
assert $state equals 0
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit uncompile -q compile-command)
assert $state equals 0
assert $output contains '==> Uncompiling compile-command [OK]'
}

View file

@ -1,4 +1,5 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
@setup {
load "${PWD}/tests/_support/annex_test_assertions"
@ -227,7 +228,7 @@
run $fnm --version; assert $state equals 0
}
@test 'fogg' { # Manage Infrastructure as Code with less pain
run zinit for @chanzuckerberg/fogg; assert $state equals 0
run zinit ver'v0.92.1' for @chanzuckerberg/fogg; assert $state equals 0
local fogg="$ZBIN/fogg"; assert "$fogg" is_executable
run $fogg version; assert $state equals 0
}
@ -881,5 +882,3 @@
# local nvim="$ZBIN/nvim"; assert "$nvim" is_executable
# $nvim --version; assert $state equals 0
# }
# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker

View file

@ -306,8 +306,7 @@ ZINIT[EXTENDED_GLOB]=""
@zinit-substitute atclone atpull
[[ $atpull = "%atclone" ]] && { eval "$atclone"; retval=$?; } || { eval "$atpull"; retval=$?; }
return $retval
}
# ]]]
} # ]]]
#
# Format functions
@ -976,32 +975,127 @@ ZINIT[EXTENDED_GLOB]=""
fi
done
} # ]]]
# FUNCTION: .zinit-compile-plugin [[[
# Compiles given plugin (its main source file, and also an
# additional "....zsh" file if it exists).
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given)
.zinit-compile-plugin () {
emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes
local id_as=$1${2:+${${${(M)1:#%}:+$2}:-/$2}} first plugin_dir filename is_snippet
local -a list
local -A ICE
.zinit-compute-ice "$id_as" "pack" ICE plugin_dir filename is_snippet || return 1
if [[ ${ICE[from]} = gh-r ]] && (( ${+ICE[compile]} == 0 )); then
+zi-log "{dbg} $0: ${id_as} has from'gh-r', skip compile"
return 0
fi
__compile_header () {
(( $#quiet )) || +zi-log "{i} {b}${1}{rst}"
}
if [[ -n "${ICE[compile]}" ]]; then
local -aU pats list=()
pats=(${(s.;.)ICE[compile]})
local pat
__compile_header "${id_as}"
for pat in $pats; do
list+=("${plugin_dir:A}/"${~pat}(.N))
done
+zi-log "{dbg} $0: pattern {glob}${pats}{rst} found ${(pj;, ;)list[@]:t}"
if [[ ${#list} -eq 0 ]]; then
+zi-log "{w} {ice}compile{apo}''{rst} didn't match any files"
else
+zi-log -n "{m} Compiling {num}${#list}{rst} file${=${list:#1}:+s} ${(pj;, ;)list[@]:t}"
integer retval
for first in $list; do
() {
builtin zcompile -Uz -- "${first}"
retval+=$?
}
done
builtin print -rl -- ${list[@]#$plugin_dir/} >| ${TMPDIR:-/tmp}/zinit.compiled.$$.lst
if (( !retval )); then
+zi-log " [{happy}OK{rst}]"
else
+zi-log " (exit code: {ehi}$retval{rst})"
fi
fi
return
fi
if [[ ${ICE[pick]} != /dev/null && ${ICE[as]} != null && ${+ICE[null]} -eq 0 && ${ICE[as]} != command && ${+ICE[binary]} -eq 0 && ( ${+ICE[nocompile]} = 0 || ${ICE[nocompile]} = \! ) ]]; then
__compile_header "${id_as}"
reply=()
if [[ -n ${ICE[pick]} ]]; then
list=(${~${(M)ICE[pick]:#/*}:-$plugin_dir/$ICE[pick]}(DN))
if [[ ${#list} -eq 0 ]]; then
+zi-log "{w} No files for compilation found (pick-ice didn't match)"
return 1
fi
reply=("${list[1]:h}" "${list[1]}")
else
if (( is_snippet )); then
if [[ -f $plugin_dir/$filename ]]; then
reply=("$plugin_dir" $plugin_dir/$filename)
elif { ! .zinit-first % "$plugin_dir" }; then
+zi-log "{m} No files for compilation found"
return 1
fi
else
.zinit-first "$1" "$2" || {
+zi-log "{m} No files for compilation found"
return 1
}
fi
fi
local pdir_path=${reply[-2]}
first=${reply[-1]}
local fname=${first#$pdir_path/}
+zi-log -n "{m} Compiling {file}${fname}{rst}"
if [[ -z ${ICE[(i)(\!|)(sh|bash|ksh|csh)]} ]]; then
() {
builtin emulate -LR zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
if { ! zcompile -Uz "$first" }; then
+zi-log "{msg2}Warning:{rst} Compilation failed. Don't worry, the plugin will work also without compilation."
+zi-log "{msg2}Warning:{rst} Consider submitting an error report to Zinit or to the plugin's author."
else
+zi-log " [{happy}OK{rst}]"
fi
zcompile -U "${${first%.plugin.zsh}%.zsh-theme}.zsh" 2> /dev/null
}
fi
fi
return 0
} # ]]]
# FUNCTION: .zinit-compile-uncompile-all [[[
# Compiles or uncompiles all existing (on disk) plugins.
#
# User-action entry point.
.zinit-compile-uncompile-all() {
builtin setopt localoptions nullglob
.zinit-compile-uncompile-all () {
emulate -L zsh
setopt extendedglob null_glob typeset_silent
local compile="$1"
typeset -a plugins
plugins=( "${ZINIT[PLUGINS_DIR]}"/*(DN) )
+zi-log "{dbg} ${compile} all"
condition () {
if [[ -e "${REPLY:h}"/id-as ]]; then
reply+=("$(cat "${REPLY:h}/id-as")")
else
reply+=("$(cat "${REPLY:A}")")
fi
}
local -aU plugins=("$ZINIT_REGISTERED_PLUGINS[@]")
plugins+=(${ZINIT[PLUGINS_DIR]}/*/\._zinit/teleid(on+condition))
local p user plugin
for p in "${plugins[@]}"; do
[[ "${p:t}" = "custom" || "${p:t}" = "_local---zinit" ]] && continue
.zinit-any-to-user-plugin "${p:t}"
[[ "${p:t}" = "custom" || "${p}" = "_local/zinit" ]] && continue
.zinit-any-to-user-plugin "${p}"
user="${reply[-2]}" plugin="${reply[-1]}"
.zinit-any-colorify-as-uspl2 "$user" "$plugin"
builtin print -r -- "$REPLY:"
if [[ "$compile" = "1" ]]; then
.zinit-compile-plugin "$user" "$plugin"
if [[ -n ${user} ]]; then
.zinit-${compile}-plugin "$user" "$plugin"
else
.zinit-uncompile-plugin "$user" "$plugin" "1"
.zinit-${compile}-plugin "$plugin"
fi
done
} # ]]]
@ -1009,34 +1103,68 @@ ZINIT[EXTENDED_GLOB]=""
# Displays list of plugins that are compiled.
#
# User-action entry point.
.zinit-compiled() {
.zinit-compiled () {
builtin setopt localoptions nullglob
typeset -a matches m
matches=( ${ZINIT[PLUGINS_DIR]}/*/*.zwc(DN) )
matches=(${ZINIT[PLUGINS_DIR]}/*/*.zwc(DN))
if [[ "${#matches[@]}" -eq "0" ]]; then
builtin print "No compiled plugins"
return 0
fi
local cur_plugin="" uspl1 file user plugin
for m in "${matches[@]}"; do
file="${m:t}"
uspl1="${${m:h}:t}"
.zinit-any-to-user-plugin "$uspl1"
user="${reply[-2]}" plugin="${reply[-1]}"
if [[ "$cur_plugin" != "$uspl1" ]]; then
[[ -n "$cur_plugin" ]] && builtin print # newline
[[ -n "$cur_plugin" ]] && builtin print
.zinit-any-colorify-as-uspl2 "$user" "$plugin"
builtin print -r -- "$REPLY:"
cur_plugin="$uspl1"
fi
builtin print "$file"
done
} # ]]]
# FUNCTION: .zinit-uncompile-plugin [[[
# Uncompiles given plugin.
#
# User-action entry point.
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user (+ plugin in $2), plugin)
# $2 - plugin (only when $1 - i.e. user - given)
.zinit-uncompile-plugin () {
emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extended_glob no_short_loops rc_quotes warn_create_global
local id_as=$1${2:+${${${(M)1:#%}:+$2}:-/$2}} filename first is_snippet m plugin_dir
local -a list
local -A ICE
.zinit-compute-ice "$id_as" "pack" ICE plugin_dir filename is_snippet || return 1
if [[ ${ICE[from]} = gh-r ]] && (( ${+ICE[compile]} == 0 )); then
+zi-log "{dbg} $0: ${id_as} has from'gh-r', skip compile"
return 0
fi
if [[ -n ${plugin_dir}/*.zwc(#qN) ]]; then
if (( $#quiet )); then
+zi-log -n "{m} Uncompiling {b}${id_as}{rst}"
else
+zi-log "{i} {file}${id_as}{rst}"
fi
integer retval
(( !$#quiet )) && +zi-log -n "{m} Removing: "
for m in ${plugin_dir}/*.zwc(.N); do
command rm -f "${m:A}"
retval+=$?
(( !$#quiet )) && +zi-log -n "{file}${m:t}{rst} "
done
if (( retval )); then
+zi-log " [exit code: {ehi}$retval{rst}]"
else
+zi-log " [{happy}OK{rst}]"
fi
fi
} # ]]]
# FUNCTION: .zinit-confirm [[[
# Prints given question, waits for "y" key, evals
# given expression if "y" obtained
@ -2292,41 +2420,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
command rm -f "${fname}.zwc"
(( compiled )) && zcompile -U "$fname"
} # ]]]
# FUNCTION: .zinit-uncompile-plugin [[[
# Uncompiles given plugin.
#
# User-action entry point.
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user (+ plugin in $2), plugin)
# $2 - plugin (only when $1 - i.e. user - given)
.zinit-uncompile-plugin() {
builtin setopt localoptions nullglob
.zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}" silent="$3"
# There are plugins having ".plugin.zsh"
# in ${plugin} directory name, also some
# have ".zsh" there
[[ "$user" = "%" ]] && local pdir_path="$plugin" || local pdir_path="${ZINIT[PLUGINS_DIR]}/${user:+${user}---}${plugin//\//---}"
typeset -a matches m
matches=( $pdir_path/*.zwc(DN) )
if [[ "${#matches[@]}" -eq "0" ]]; then
if [[ "$silent" = "1" ]]; then
builtin print "not compiled"
else
.zinit-any-colorify-as-uspl2 "$user" "$plugin"
builtin print -r -- "$REPLY not compiled"
fi
return 1
fi
for m in "${matches[@]}"; do
builtin print "Removing ${ZINIT[col-info]}${m:t}${ZINIT[col-rst]}"
command rm -f "$m"
done
} # ]]]
# FUNCTION: .zinit-unload [[[
# 1. call the zsh plugin's standard *_plugin_unload function
# 2. call the code provided by the zsh plugin's standard @zsh-plugin-run-at-update

View file

@ -812,106 +812,6 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
unfunction -- 2>/dev/null "$f"
} # ]]]
# FUNCTION: .zinit-compile-plugin [[[
# Compiles given plugin (its main source file, and also an
# additional "....zsh" file if it exists).
#
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given)
.zinit-compile-plugin() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
builtin setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes
local id_as=$1${2:+${${${(M)1:#%}:+$2}:-/$2}} first plugin_dir filename is_snippet
local -a list
local -A ICE
.zinit-compute-ice "$id_as" "pack" \
ICE plugin_dir filename is_snippet || return 1
# when from"gh-r" ice set, skip compile unless compile ice is set
if [[ ${ICE[from]} = gh-r ]] && (( ${+ICE[compile]} == 0 )); then
+zi-log '{dbg} from"gh-r" detected, skipping compile'
return 0
fi
if [[ ${ICE[pick]} != /dev/null && ${ICE[as]} != null && \
${+ICE[null]} -eq 0 && ${ICE[as]} != command && ${+ICE[binary]} -eq 0 && \
( ${+ICE[nocompile]} = 0 || ${ICE[nocompile]} = \! )
]] {
reply=()
if [[ -n ${ICE[pick]} ]]; then
list=( ${~${(M)ICE[pick]:#/*}:-$plugin_dir/$ICE[pick]}(DN) )
if [[ ${#list} -eq 0 ]] {
builtin print "No files for compilation found (pick-ice didn't match)."
return 1
}
reply=( "${list[1]:h}" "${list[1]}" )
else
if (( is_snippet )) {
if [[ -f $plugin_dir/$filename ]] {
reply=( "$plugin_dir" $plugin_dir/$filename )
} elif { ! .zinit-first % "$plugin_dir" } {
+zi-log "{m} No files for compilation found"
return 1
}
} else {
.zinit-first "$1" "$2" || {
+zi-log "{m} No files for compilation found"
return 1
}
}
fi
local pdir_path=${reply[-2]}
first=${reply[-1]}
local fname=${first#$pdir_path/}
+zi-log -n "{m} Compiling {file}$fname{rst}"
if [[ -z ${ICE[(i)(\!|)(sh|bash|ksh|csh)]} ]] {
() {
builtin emulate -LR zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
if { ! zcompile -U "$first" } {
+zi-log "{msg2}Warning:{rst} Compilation failed. Don't worry, the plugin will work also without compilation."
+zi-log "{msg2}Warning:{rst} Consider submitting an error report to Zinit or to the plugin's author."
} else {
+zi-log " [{happy}OK{rst}]"
}
# Try to catch possible additional file
zcompile -U "${${first%.plugin.zsh}%.zsh-theme}.zsh" 2>/dev/null
}
}
}
if [[ -n "${ICE[compile]}" ]]; then
local -a pats
pats=( ${(s.;.)ICE[compile]} )
local pat
list=()
for pat ( $pats ) {
eval "list+=( \$plugin_dir/$~pat(N) )"
}
if [[ ${#list} -eq 0 ]] {
+zi-log "{w} ice {ice}compile{apo}''{rst} didn't match any files."
} else {
integer retval
for first in $list; do
() {
builtin emulate -LR zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
zcompile -U "$first"; retval+=$?
}
done
builtin print -rl -- ${list[@]#$plugin_dir/} >! ${TMPDIR:-/tmp}/zinit.compiled.$$.lst
+zi-log -n "{m} {num}${#list}{rst} compiled file${=${list:#1}:+s} added to {var}\$ADD_COMPILED{rst} array"
if (( retval )) {
+zi-log " (exit code: {ehi}$retval{rst})"
} else {
+zi-log ' '
}
}
fi
return 0
} # ]]]
# FUNCTION: .zinit-download-snippet [[[
# Downloads snippet
# file with curl, wget, lftp or lynx,
@ -2427,28 +2327,27 @@ __zinit-cmake-base-hook () {
)
} # ]]]
# FUNCTION: ∞zinit-compile-plugin-hook [[[
∞zinit-compile-plugin-hook() {
[[ "$1" = plugin ]] && \
local dir="${5#%}" hook="$6" subtype="$7" || \
∞zinit-compile-plugin-hook () {
if [[ "$1" = plugin ]]; then
local dir="${5#%}" hook="$6" subtype="$7"
else
local dir="${4#%}" hook="$5" subtype="$6"
if ! [[ ( $hook = *\!at(clone|pull)* && ${+ICE[nocompile]} -eq 0 ) || \
( $hook = at(clone|pull)* && $ICE[nocompile] = '!' ) ]] {
fi
if ! [[ ( $hook = *\!at(clone|pull)* && ${+ICE[nocompile]} -eq 0 ) || ( $hook = at(clone|pull)* && $ICE[nocompile] = '!' ) ]]; then
return 0
}
# Compile plugin
if [[ -z $ICE[(i)(\!|)(sh|bash|ksh|csh)] ]] {
fi
if [[ -z $ICE[(i)(\!|)(sh|bash|ksh|csh)] ]]; then
() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob warncreateglobal
if [[ $tpe == snippet ]] {
.zinit-compile-plugin "%$dir" ""
} else {
.zinit-compile-plugin "$id_as" ""
}
builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
setopt local_options extended_glob warn_create_global
local quiet=1
if [[ $tpe == snippet ]]; then
.zinit-compile-plugin "%$dir"
else
.zinit-compile-plugin "$id_as"
fi
}
}
fi
} # ]]]
# FUNCTION: ∞zinit-atpull-e-hook [[[
∞zinit-atpull-e-hook() {

View file

@ -209,7 +209,7 @@ if [[ -z $SOURCED && ( ${+terminfo} -eq 1 && -n ${terminfo[colors]} ) || ( ${+te
col-aps $'\e[38;5;117m' col-flag $'\e[1;3;38;5;79m' col-nb $'\e[22m' col-rst $'\e[0m'
col-b $'\e[1m' col-func $'\e[38;5;219m' col-nit $'\e[23m' col-slight $'\e[38;5;230m'
col-b-lhi $'\e[1m\e[38;5;75m' col-glob $'\e[38;5;227m' col-nl $'\n' col-st $'\e[9m'
col-b-warn $'\e[1;38;5;214m' col-happy $'\e[1m\e[38;5;82m' col-note $'\e[38;5;148m' col-tab $' \t '
col-b-warn $'\e[1;38;5;214m' col-happy $'\e[1m\e[38;5;82m' col-note $'\e[38;5;148m' col-tab $' \t '
col-bapo $'\e[1;38;5;220m' col-hi $'\e[1m\e[38;5;183m' col-nst $'\e[29m' col-term $'\e[38;5;185m'
col-baps $'\e[1;38;5;82m' col-ice $'\e[38;5;39m' col-nu $'\e[24m' col-th-bar $'\e[38;5;82m'
col-bar $'\e[38;5;82m' col-id-as $'\e[4;38;5;220m' col-num $'\e[3;38;5;155m' col-time $'\e[38;5;220m'
@ -1340,8 +1340,7 @@ builtin setopt noaliases
___retval+=$?
return __retval
}
# ]]]
} # ]]]
# FUNCTION: .zinit-set-m-func [[[
# Sets and withdraws the temporary, atclone/atpull time function `m`.
.zinit-set-m-func() {
@ -2613,8 +2612,7 @@ zinit() {
)
cmd="$1"
if [[ $cmd == (times|unload|env-whitelist|update|snippet|load|light|cdreplay|\
cdclear) ]]; then
if [[ $cmd == (times|unload|env-whitelist|update|snippet|load|light|cdreplay|cdclear) ]]; then
if (( $@[(I)-*] || OPTS[opt_-h,--help] )); then
.zinit-parse-opts "$cmd" "$@"
if (( OPTS[opt_-h,--help] )); then
@ -2890,13 +2888,12 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
(cdclear)
.zinit-compdef-clear "$2"
;;
(add-fpath|fpath)
((add-|)fpath)
.zinit-add-fpath "${@[2-correct,-1]}"
;;
(run)
.zinit-run "${@[2-correct,-1]}"
;;
(man)
man "${ZINIT[BIN_DIR]}/doc/zinit.1"
;;
@ -3064,13 +3061,29 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
(( ${+functions[.zinit-forget-completion]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh" || return 1
.zinit-compinit; ___retval=$?
;;
(compile)
(( ${+functions[.zinit-compile-plugin]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh" || return 1
if [[ $2 = --all || ( -z $2 && -z $3 ) ]]; then
[[ -z $2 ]] && { builtin print -r -- "Assuming --all is passed"; }
.zinit-compile-uncompile-all 1; ___retval=$?
(compiled)
.zinit-compiled
;;
(compile|uncompile)
(( ${+functions[.zinit-compile-plugin]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
local action="$1" all f help quiet
shift
zparseopts -D -F -K -- {a,-all}=all {h,-help}=help {q,-quiet}=quiet || return
if (( $#help )); then
print "Usage:"
print " zinit ${0} <options> <plugin>"
print " "
print "Options:"
print " -a, --all Checkout the specified branch"
print " -h, --help Checkout the specified branch"
print " -q, --quiet Checkout the specified tag or commit"
fi
if (( $#all )); then
.zinit-compile-uncompile-all ${action}; ___retval="${?}"
else
.zinit-compile-plugin "${2%%(///|//|/)}" "${3%%(///|//|/)}"; ___retval=$?
for f in ${(q+)^@}; do
.zinit-$action-plugin "${f}"; (( ___retval += ${?} ))
done
fi
;;
(debug)
@ -3078,21 +3091,11 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
(( ${+functions[+zinit-debug]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-additional.zsh"
+zinit-debug $@
;;
(uncompile)
if [[ $2 = --all || ( -z $2 && -z $3 ) ]]; then
[[ -z $2 ]] && { builtin print -r -- "Assuming --all is passed"; }
.zinit-compile-uncompile-all 0; ___retval=$?
else
.zinit-uncompile-plugin "${2%%(///|//|/)}" "${3%%(///|//|/)}"; ___retval=$?
fi
;;
(compiled)
.zinit-compiled
;;
(cdlist)
.zinit-list-compdef-replay
;;
(cd|recall|edit|glance|changes|create|stress)
((c(hanges|d))|create|edit|glance|recall|stress)
.zinit-"$1" "${@[2-correct,-1]%%(///|//|/)}"; ___retval=$?
;;
(recently)