mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
fix: don't use $functions_source for compatibility with zsh < 5.4
This commit is contained in:
parent
aa75eeea33
commit
4fcf52c2b1
2 changed files with 42 additions and 32 deletions
|
|
@ -1,11 +1,14 @@
|
|||
# with lots of 3rd-party amazing aliases installed, just need something to explore it quickly.
|
||||
#
|
||||
# - acs: alias cheatsheet
|
||||
# group alias by command, pass addition argv to grep.
|
||||
function acs(){
|
||||
(( $+commands[python3] )) || {
|
||||
echo "[error] No python executable detected"
|
||||
return
|
||||
# Handle $0 according to the standard:
|
||||
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
|
||||
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
|
||||
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||
|
||||
eval '
|
||||
function acs(){
|
||||
(( $+commands[python3] )) || {
|
||||
echo "[error] No python executable detected"
|
||||
return
|
||||
}
|
||||
alias | python3 "'"${0:h}"'/cheatsheet.py" "$@"
|
||||
}
|
||||
alias | python3 ${functions_source[$0]:h}/cheatsheet.py $@
|
||||
}
|
||||
'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue