foxshell/fn/-z4h-cmd-help
2025-07-04 11:48:40 -05:00

54 lines
1.6 KiB
Bash

#!/usr/bin/env zsh
eval "$_z4h_opt"
if (( ARGC == 1 )); then
case $1 in
install)
print -Pr -- "Usage: %F{2}z4h%f %Binstall%b [-f|--force] [%Uuser/project[@branch]%u]..."
print -Pr -- ""
print -Pr -- "Clone or update GitHub project(s)."
;;
update)
print -Pr -- "Usage: %F{2}z4h%f %Bupdate%b"
print -Pr -- ""
print -Pr -- "Update %Bzsh4humans%b and all dependencies (%Bfzf%b, %Bzsh-autosuggestions%b, etc.)."
;;
init)
print -Pr -- "Usage: %F{2}z4h%f %Binit%b"
print -Pr -- ""
print -Pr -- "Initialize Zsh. Should be called just once from %U.zshrc%u."
;;
help)
print -Pr -- "Usage: %F{2}z4h%f %Bhelp%b [%Ucommand%u]"
print -Pr -- ""
print -Pr -- "Print help for the command."
;;
*)
if (( $+functions[-z4h-help-$1] )); then
-z4h-help-$1
else
print -Pru2 -- "%F{3}z4h%f: unknown command: %F{1}${1//\%/%%}%f"
return 1
fi
;;
esac
return
fi
if (( ARGC == 0 )); then
local fd=1 ret=0
else
local fd=2 ret=1
fi
print -Pru$fd -- "Usage: %F{2}z4h%f %Binstall%b [-f|--force] [%Uuser/project[@branch]%u]..."
print -Pru$fd -- " %Bupdate%b"
print -Pru$fd -- " %Binit%b"
print -Pru$fd -- " %Bsource%b [-c|--compile] [--] [%Ufile%u]..."
print -Pru$fd -- " %Bcompile%b [--] [%Ufile%u]..."
print -Pru$fd -- " %Bload%b [-c|--compile] [--] [%Udir%u]..."
print -Pru$fd -- " %Bbindkey%b [--] zle-widget [key-binding] [key-binding]..."
print -Pru$fd -- " %Bssh%b [%Ussh-options%u] [%Uuser@%u]%Uhostname%u"
print -Pru$fd -- " %Bhelp%b [%Ucommand%u]"
return ret