Skip to content

Commit

Permalink
fix: compile command logic when using id-as ice (#619)
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
vladdoster authored Mar 4, 2024
1 parent 6511ca7 commit b7b8347
Show file tree
Hide file tree
Showing 18 changed files with 331 additions and 5,622 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
m4 \
ninja-build \
pkg-config \
xz-utils
xz-utils \
zsh
- name: "install dependencies"
id: install-deps
Expand All @@ -63,17 +64,21 @@ 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

- 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

Expand Down
2 changes: 1 addition & 1 deletion .zunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ directories:
output: tests/_output
support: tests/_support
tests: tests
fail_fast: false
fail_fast: true
verbose: true
42 changes: 36 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![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)
Expand Down Expand Up @@ -853,11 +853,41 @@ Following commands are passed to `zinit ...` to obtain described effects.

### 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>

Expand Down
18 changes: 12 additions & 6 deletions _zinit
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -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(){
Expand Down
Loading

0 comments on commit b7b8347

Please sign in to comment.