-
Notifications
You must be signed in to change notification settings - Fork 2
/
z-a-rust.plugin.zsh
executable file
·36 lines (29 loc) · 1.19 KB
/
z-a-rust.plugin.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
#
# Copyright (c) 2021 Z-Shell Community
#
# According to the Zsh Plugin Standard:
# https://wiki.zshell.dev/community/zsh_plugin_standard/#zero-handling
0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
0="${${(M)0:#/*}:-$PWD/$0}"
# https://wiki.zshell.dev/community/zsh_plugin_standard/#funtions-directory
if [[ $PMSPEC != *f* ]]; then
fpath+=( "${0:h}/functions" )
fi
# https://wiki.zshell.dev/community/zsh_plugin_standard/#the-proposed-function-name-prefixes
autoload -Uz .za-rust-{bin-or-src-function-body,download-file-stdout,{atload,atclone,atpull,atdelete,help}-handler}
# An empty stub to fill the help handler fields
.za-rust-null-handler() { :; }
@zi-register-annex "z-a-rust" hook:atload-40 \
.za-rust-atload-handler \
.za-rust-help-handler "rustup|cargo''" # also register new ices
@zi-register-annex "z-a-rust" hook:atclone-40 \
.za-rust-atclone-handler \
.za-rust-null-handler
@zi-register-annex "z-a-rust" hook:\%atpull-40 \
.za-rust-atclone-handler \
.za-rust-null-handler
@zi-register-annex "z-a-rust" hook:atdelete-40 \
.za-rust-atdelete-handler \
.za-rust-null-handler