diff --git a/Makefile b/Makefile index c3601f1..84b83c2 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,24 @@ -MODVERSION := 1.0 +MODVERSION := $(shell sed -n 's/version=\(.*\)/\1/p' zsh_arm64/module.prop) MOD := zsh_arm64 ZIP := $(MOD)-$(MODVERSION).zip #ZIP := $(MOD)-$(MODVERSION)-$(shell date +%m-%d).zip VCODE := $(subst .,,$(MODVERSION)) + DEPS := $(shell find $(MOD) -type f) +STAGEDEPS := $(DEPS:$(MOD)/%=$(STAGE)/%) ZSHVERSION := 5.7 SRCDIR=zsh-$(ZSHVERSION) SRCURL := https://sourceforge.net/projects/zsh/files/zsh/$(ZSHVERSION)/zsh-$(ZSHVERSION).tar.xz/download -ARCHIVE := $(SRCDIR).tar.gz +ARCHIVE := $(SRCDIR).tar.xz +STAGE := stage CURDIR := $(shell pwd) PROCS := $(shell nproc) +.PHONY: + all: out/$(ZIP) build/work/$(ARCHIVE): @@ -27,52 +32,62 @@ build/work/$(SRCDIR)/Makefile: build/work/$(ARCHIVE) ./Util/preconfig; \ cp ../../config.modules .; \ ./configure \ - --host=aarch64-linux-gnu \ --bindir=/system/xbin \ - --sbindir=/system/xbin \ - --libexecdir=/system/xbin \ --datarootdir=/system/usr/share \ - --prefix=/system \ + --disable-dynamic \ + --disable-dynamic-nss \ + --disable-gdbm \ + --disable-restricted-r \ + --disable-runhelpdir \ --enable-cppflags=-static \ --enable-ldflags=-static \ --enable-zshenv=/system/etc/zsh/zshenv \ --enable-zprofile=/system/etc/zsh/zprofile \ --enable-zlogin=/system/etc/zsh/zlogin \ --enable-zlogout=/system/etc/zsh/zlogout \ - --disable-dynamic \ - --disable-restricted-r \ - --disable-dynamic-nss \ - --disable-gdbm \ + --enable-multibyte \ --enable-pcre \ --enable-site-fndir=/system/usr/share/zsh/functions \ --enable-fndir=/system/usr/share/zsh/functions \ - --disable-runhelpdir \ - --sysconfdir=/system/etc \ + --enable-function-subdirs \ + --enable-scriptdir=/system/usr/share/zsh/scripts \ + --enable-site-scriptdir=/system/usr/share/zsh/scripts \ --enable-etcdir=/system/etc \ - --enable-libs=-lpthread + --enable-libs=-lpthread \ + --host=aarch64-linux-gnu \ + --libexecdir=/system/xbin \ + --prefix=/system \ + --sbindir=/system/xbin \ + --sysconfdir=/system/etc +# --disable-runhelpdir \ build/work/$(SRCDIR)/Src/zsh: build/work/$(SRCDIR)/Makefile $(DEPS) cd $(CURDIR)/build/work/$(SRCDIR); \ make -j$(PROCS) -$(MOD)/system/xbin/zsh: build/work/$(SRCDIR)/Src/zsh +$(STAGE)/%: build/work/$(SRCDIR)/Src/zsh cd $(CURDIR)/build/work/$(SRCDIR); \ - make install DESTDIR=$(CURDIR)/$(MOD); \ - chmod 755 $(CURDIR)/$(MOD)/system/xbin/* + make install DESTDIR=$(CURDIR)/$(STAGE); \ + chmod 755 $(CURDIR)/$(STAGE)/system/xbin/* +$(STAGE)/%: $(MOD)/% + mkdir -p $(@D) + cp $< $@ -out/$(ZIP): $(MOD)/system/xbin/zsh - cd $(MOD); \ +out/$(ZIP): $(STAGE)/% + cd $(STAGE); \ rm -rf system/usr/share/man; \ rm system/xbin/zsh-* system/xbin/zsh.old; \ sed -i "s/version=.*/version=$(MODVERSION)/" module.prop; \ sed -i "s/versionCode=.*/versionCode=$(VCODE)/" module.prop; \ - zip -r ../out/$(ZIP) $(notdir $(wildcard $(MOD)/*)) + zip -r ../out/$(ZIP) $(notdir $(wildcard $(STAGE)/*)) clean: - rm -f out/*.zip rm -rf build/work/* - rm -rf $(MOD)/system/xbin/zsh $(MOD)/system/usr/share/zsh + rm -rf $(STAGE)/* + +distclean: clean + rm -f out/*.zip diff --git a/build/build-zsh.sh b/build/build-zsh.sh deleted file mode 100755 index a6a35fd..0000000 --- a/build/build-zsh.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/zsh -# - -SOURCE_URL="https://github.com/zsh-users/zsh/archive/zsh-5.7.1.tar.gz" - -[ -z "$NDK_BUILD" ] && { echo "NDK_BUILD not defined"; exit 1; } - -wget "$SOURCE_URL" -tar xvf zsh-5.7.1.tar.gz -cd zsh-zsh-5.7.1 - - -# First, be sure to copy over the config.modules file from this directory to the root of -# the source tree. -cp ../config.modules . - -# The following command was used to configure zsh: -./configure \ - --host=aarch64-unknown-linux-gnu\ - --bindir=/system/xbin \ - --sbindir=/system/xbin \ - --libexecdir=/system/xbin \ - --datarootdir=/system/usr/share \ - --prefix=/system \ - --enable-cppflags='-static -fPIC' \ - --enable-cppflags='-fPIC' \ - --enable-ldflags=-static \ - --enable-zshenv=/system/etc/zsh/zshenv \ - --enable-zprofile=/system/etc/zsh/zprofile \ - --enable-zlogin=/system/etc/zsh/zlogin \ - --enable-zlogout=/system/etc/zsh/zlogout \ - --disable-dynamic \ - --disable-restricted-r \ - --enable-pcre \ - --disable-gdbm \ - --disable-dynamic-nss \ - --enable-site-fndir=/system/usr/share/zsh/functions \ - --enable-fndir=/system/usr/share/zsh/functions \ - --disable-runhelpdir \ - --enable-function-subdirs \ - --sysconfdir=/system/etc \ - --enable-etcdir=/system/etc \ - --enable-libs=-lpthread - diff --git a/zsh_arm64/module.prop b/zsh_arm64/module.prop index 11efd17..ec37782 100644 --- a/zsh_arm64/module.prop +++ b/zsh_arm64/module.prop @@ -1,7 +1,7 @@ id=zsh_arm64 name=ZSH for Arm -version=1.0 -versionCode=10 +version=1.1 +versionCode=11 author=me@partcyb.org description=Zsh is a modern *nix shell with many advanced features. minMagisk=1700 diff --git a/zsh_arm64/system/etc/zsh/newuser.zshrc.recommended b/zsh_arm64/system/etc/zsh/newuser.zshrc.recommended deleted file mode 100644 index 55be3ab..0000000 --- a/zsh_arm64/system/etc/zsh/newuser.zshrc.recommended +++ /dev/null @@ -1,37 +0,0 @@ -# Set up the prompt - -autoload -Uz promptinit -promptinit -prompt adam1 - -setopt histignorealldups sharehistory - -# Use emacs keybindings even if our EDITOR is set to vi -bindkey -e - -# Keep 1000 lines of history within the shell and save it to ~/.zsh_history: -HISTSIZE=1000 -SAVEHIST=1000 -HISTFILE=~/.zsh_history - -# Use modern completion system -autoload -Uz compinit -compinit - -zstyle ':completion:*' auto-description 'specify: %d' -zstyle ':completion:*' completer _expand _complete _correct _approximate -zstyle ':completion:*' format 'Completing %d' -zstyle ':completion:*' group-name '' -zstyle ':completion:*' menu select=2 -eval "$(dircolors -b)" -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*' list-colors '' -zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s -zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' -zstyle ':completion:*' menu select=long -zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s -zstyle ':completion:*' use-compctl false -zstyle ':completion:*' verbose true - -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' -zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' diff --git a/zsh_arm64/system/usr/share/zsh/5.7/scripts/newuser b/zsh_arm64/system/usr/share/zsh/5.7/scripts/newuser deleted file mode 100644 index b5d7421..0000000 --- a/zsh_arm64/system/usr/share/zsh/5.7/scripts/newuser +++ /dev/null @@ -1,8 +0,0 @@ -# zsh script sourced at startup when a user is found to have -# no startup files. See the documentation for the zsh/newuser -# module in zshmodules(1). - -if functions zsh-newuser-install >/dev/null 2>&1 || - autoload -U +X zsh-newuser-install; then - zsh-newuser-install -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_add-zle-hook-widget b/zsh_arm64/system/usr/share/zsh/functions/_add-zle-hook-widget deleted file mode 100644 index f108d18..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_add-zle-hook-widget +++ /dev/null @@ -1,36 +0,0 @@ -#compdef add-zle-hook-widget - -_add-zle-hook-widget_types() { - local -a tmp - - autoload -U add-zle-hook-widget - add-zle-hook-widget -h >&/dev/null # sets the zstyle - zstyle -g tmp zle-hook types - - compadd "$@" -M 'L:|=zle-' -M 'r:|-=* r:|=*' -- zle-${^tmp} -} - -_add-zle-hook-widget_widgets() { - local expl - if (( $+opt_args[-d] )); then - local -a tmp - zstyle -g tmp $line[1] widgets - _wanted widgets expl "installed hook" compadd -- ${tmp#<->:} && return 0 - else - _wanted widgets expl widget _widgets -g 'user:*' && return 0 - fi - return 1 -} - -_add-zle-hook-widget() { - local context state state_descr line - typeset -A opt_args - _arguments -s -w -S : \ - '(-D)-d[remove HOOK from the array]' \ - '(-d)-D[interpret HOOK as pattern to remove from the array]' \ - {-U,-z,-k}"[passed to 'autoload']" \ - ':hook type:_add-zle-hook-widget_types' \ - ':widget:_add-zle-hook-widget_widgets' -} - -_add-zle-hook-widget "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_add-zsh-hook b/zsh_arm64/system/usr/share/zsh/functions/_add-zsh-hook deleted file mode 100644 index e8ae970..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_add-zsh-hook +++ /dev/null @@ -1,24 +0,0 @@ -#compdef add-zsh-hook - -_add-zsh-hook_hooks() { - local expl - if (( $+opt_args[-d] )); then - _wanted functions expl "installed hooks" compadd -a - "$line[1]_functions" && return 0 - else - _functions && return 0 - fi - return 1 -} - -_add-zsh-hook() { - local context state state_descr line - typeset -A opt_args - _arguments -s -w -S : \ - '(-D)-d[remove HOOK from the array]' \ - '(-d)-D[interpret HOOK as pattern to remove from the array]' \ - {-U,-z,-k}"[passed to 'autoload']" \ - ':hook class:(chpwd precmd preexec periodic zshaddhistory zshexit zsh_directory_name)' \ - ':hook function:_add-zsh-hook_hooks' -} - -_add-zsh-hook "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_alias b/zsh_arm64/system/usr/share/zsh/functions/_alias deleted file mode 100644 index 617627c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_alias +++ /dev/null @@ -1,24 +0,0 @@ -#compdef alias - -local curcontext="$curcontext" state line expl type suf -typeset -A opt_args - -_arguments -C -s -A "-*" -S \ - '(-r +r -s +s)-+g[list or define global aliases]' \ - '(-g +g -s +s)-+r[list or define regular aliases]' \ - '(-r +r -g +g)-+s[list or define suffix aliases]' \ - '-+m[print aliases matching specified pattern]' \ - '-L[print each alias in the form of calls to alias]' \ - '*::alias definition:->defn' - -if [[ -n "$state" ]]; then - if compset -P 1 '*='; then - compset -q - _normal - else - compset -S '=*' || suf='=' - type=( ${opt_args[(i)[-+][grs]]#?} ) - (( $#type )) && type=( -s $type ) - _wanted -x alias expl 'alias definition' _aliases -qS "$suf" "$type[@]" - fi -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_aliases b/zsh_arm64/system/usr/share/zsh/functions/_aliases deleted file mode 100644 index 6506ece..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_aliases +++ /dev/null @@ -1,19 +0,0 @@ -#compdef unalias - -local expl sel args opts - -zparseopts -E -D s:=sel - -[[ -z $sel ]] && sel=rgs - -opts=( "$@" ) - -args=() -[[ $sel = *r* ]] && args=( $args 'aliases:regular alias:compadd -k aliases' ) -[[ $sel = *g* ]] && args=( $args 'global-aliases:global alias:compadd -k galiases' ) -[[ $sel = *s* ]] && args=( $args 'suffix-aliases:suffix alias:compadd -k saliases' ) -[[ $sel = *R* ]] && args=( $args 'disabled-aliases:disabled regular alias:compadd -k dis_aliases' ) -[[ $sel = *G* ]] && args=( $args 'disabled-global-aliases:disabled global alias:compadd -k dis_galiases' ) -[[ $sel = *S* ]] && args=( $args 'disabled-suffix-aliases:disabled suffix alias:compadd -k dis_saliases' ) - -_alternative -O opts $args diff --git a/zsh_arm64/system/usr/share/zsh/functions/_all_labels b/zsh_arm64/system/usr/share/zsh/functions/_all_labels deleted file mode 100644 index e607d63..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_all_labels +++ /dev/null @@ -1,43 +0,0 @@ -#autoload - -local __gopt __len __tmp __pre __suf __ret=1 __descr __spec __prev - -if [[ "$1" = - ]]; then - __prev=- - shift -fi - -__gopt=() -zparseopts -D -a __gopt 1 2 V J x - -__tmp=${argv[(ib:4:)-]} -__len=$# -if [[ __tmp -lt __len ]]; then - __pre=$(( __tmp-1 )) - __suf=$__tmp -elif [[ __tmp -eq $# ]]; then - __pre=-2 - __suf=$(( __len+1 )) -else - __pre=4 - __suf=5 -fi - -while comptags "-A$__prev" "$1" curtag __spec; do - (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" - _tags_level=$#funcstack - _comp_tags="$_comp_tags $__spec " - if [[ "$curtag" = *[^\\]:* ]]; then - zformat -f __descr "${curtag#*:}" "d:$3" - _description "$__gopt[@]" "${curtag%:*}" "$2" "$__descr" - curtag="${curtag%:*}" - - "$4" "${(P@)2}" "${(@)argv[5,-1]}" && __ret=0 - else - _description "$__gopt[@]" "$curtag" "$2" "$3" - - "${(@)argv[4,__pre]}" "${(P@)2}" "${(@)argv[__suf,-1]}" && __ret=0 - fi -done - -return __ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_all_matches b/zsh_arm64/system/usr/share/zsh/functions/_all_matches deleted file mode 100644 index 59a6d80..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_all_matches +++ /dev/null @@ -1,47 +0,0 @@ -#autoload - -_all_matches() { - local old - - zstyle -s ":completion:${curcontext}:" old-matches old - - if [[ "$old" = (only|true|yes|1|on) ]]; then - - if [[ -n "$compstate[old_list]" ]]; then - compstate[insert]=all - compstate[old_list]=keep - return 0 - fi - - [[ "$old" = *only* ]] && return 1 - fi - - (( $comppostfuncs[(I)_all_matches_end] )) || - comppostfuncs=( "$comppostfuncs[@]" _all_matches_end ) - - _all_matches_context=":completion:${curcontext}:" - - return 1 -} - -_all_matches_end() { - local not - - zstyle -s "$_all_matches_context" avoid-completer not || - not=( _expand _old_list _correct _approximate ) - - if [[ "$compstate[nmatches]" -gt 1 && $not[(I)(|_)$_completer] -eq 0 ]]; then - local expl - - if zstyle -t "$_all_matches_context" insert; then - compstate[insert]=all - else - _description all-matches expl 'all matches' - compadd "$expl[@]" -C - fi - fi - - unset _all_matches_context -} - -_all_matches "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_alternative b/zsh_arm64/system/usr/share/zsh/functions/_alternative deleted file mode 100644 index 3c61d11..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_alternative +++ /dev/null @@ -1,83 +0,0 @@ -#autoload - -local tags def expl descr action mesgs nm="$compstate[nmatches]" subopts -local opt ws curcontext="$curcontext" - -subopts=() -while getopts 'O:C:' opt; do - case "$opt" in - O) subopts=( "${(@P)OPTARG}" ) ;; - C) curcontext="${curcontext%:*}:$OPTARG" ;; - esac -done - -shift OPTIND-1 - -[[ "$1" = -(|-) ]] && shift - -mesgs=() - -_tags "${(@)argv%%:*}" - -while _tags; do - for def; do - if _requested "${def%%:*}"; then - descr="${${def#*:}%%:*}" - action="${def#*:*:}" - - _description "${def%%:*}" expl "$descr" - - if [[ "$action" = \ # ]]; then - - # An empty action means that we should just display a message. - - mesgs=( "$mesgs[@]" "${def%%:*}:$descr") - elif [[ "$action" = \(\(*\)\) ]]; then - - # ((...)) contains literal strings with descriptions. - - eval ws\=\( "${action[3,-3]}" \) - - _describe -t "${def%%:*}" "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" - elif [[ "$action" = \(*\) ]]; then - - # Anything inside `(...)' is added directly. - - eval ws\=\( "${action[2,-2]}" \) - - _all_labels "${def%%:*}" expl "$descr" \ - compadd "$subopts[@]" -a - ws - elif [[ "$action" = \{*\} ]]; then - - # A string in braces is evaluated. - - while _next_label "${def%%:*}" expl "$descr"; do - eval "$action[2,-2]" - done - elif [[ "$action" = \ * ]]; then - - # If the action starts with a space, we just call it. - - eval "action=( $action )" - while _next_label "${def%%:*}" expl "$descr"; do - "$action[@]" - done - else - - # Otherwise we call it with the description-arguments built above. - - eval "action=( $action )" - while _next_label "${def%%:*}" expl "$descr"; do - "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}" - done - fi - fi - done - [[ nm -ne compstate[nmatches] ]] && return 0 -done - -for descr in "$mesgs[@]"; do - _message -e "${descr%%:*}" "${descr#*:}" -done - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_approximate b/zsh_arm64/system/usr/share/zsh/functions/_approximate deleted file mode 100644 index dcd8b27..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_approximate +++ /dev/null @@ -1,125 +0,0 @@ -#autoload - -# This code will try to correct the string on the line based on the -# strings generated for the context. These corrected strings will be -# shown in a list and one can cycle through them as in a menu completion -# or get the corrected prefix. - -# We don't try correction if the string is too short or we have tried it -# already. - -[[ _matcher_num -gt 1 || "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1 - -local _comp_correct _correct_expl _correct_group comax cfgacc match -local oldcontext="${curcontext}" opm="$compstate[pattern_match]" -local dounfunction -integer ret=1 - -if [[ "$1" = -a* ]]; then - cfgacc="${1[3,-1]}" -elif [[ "$1" = -a ]]; then - cfgacc="$2" -else - zstyle -s ":completion:${curcontext}:" max-errors cfgacc || - cfgacc='2 numeric' -fi - -# Get the number of errors to accept. - -if [[ "$cfgacc" = *numeric* && ${NUMERIC:-1} -ne 1 ]]; then - # A numeric argument may mean that we should not try correction. - - [[ "$cfgacc" = *not-numeric* ]] && return 1 - - # Prefer the numeric argument if that has a sensible value. - - comax="${NUMERIC:-1}" -else - comax="${cfgacc//[^0-9]}" -fi - -# If the number of errors to accept is too small, give up. - -[[ "$comax" -lt 1 ]] && return 1 - -_tags corrections original - -# Otherwise temporarily define a function to use instead of -# the builtin that adds matches. This is used to be able -# to stick the `(#a...)' in the right place (after an -# ignored prefix). -# -# Current shell structure for use with "always", to make sure -# we unfunction the compadd. -{ -if (( ! $+functions[compadd] )); then - dounfunction=1 - compadd() { - local ppre="$argv[(I)-p]" - - [[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 && - "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return - - if [[ "$PREFIX" = \~* && ( ppre -eq 0 || "$argv[ppre+1]" != \~* ) ]]; then - PREFIX="~(#a${_comp_correct})${PREFIX[2,-1]}" - else - PREFIX="(#a${_comp_correct})$PREFIX" - fi - - (( $_correct_group && ${${argv[1,(r)-(|-)]}[(I)-*[JV]]} )) && - _correct_expl[_correct_group]=${argv[1,(r)-(-|)][(R)-*[JV]]} - - builtin compadd "$_correct_expl[@]" "$@" - } -fi - -_comp_correct=1 - -[[ -z "$compstate[pattern_match]" ]] && compstate[pattern_match]='*' - -while [[ _comp_correct -le comax ]]; do - curcontext="${oldcontext/(#b)([^:]#:[^:]#:)/${match[1][1,-2]}-${_comp_correct}:}" - - _description corrections _correct_expl corrections \ - "e:$_comp_correct" "o:$PREFIX$SUFFIX" - - _correct_group="$_correct_expl[(I)-*[JV]]" - - if _complete; then - if zstyle -t ":completion:${curcontext}:" insert-unambiguous && - [[ "${#compstate[unambiguous]}" -ge "${#:-$PREFIX$SUFFIX}" ]]; then - compstate[pattern_insert]=unambiguous - elif _requested original && - { [[ compstate[nmatches] -gt 1 ]] || - zstyle -t ":completion:${curcontext}:" original }; then - local expl - - _description -V original expl original - - builtin compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX" - - # If you always want to see the list of possible corrections, - # set `compstate[list]=list force' here. - - [[ "$compstate[list]" != list* ]] && - compstate[list]="$compstate[list] force" - fi - compstate[pattern_match]="$opm" - - ret=0 - break - fi - - [[ "${#:-$PREFIX$SUFFIX}" -le _comp_correct+1 ]] && break - (( _comp_correct++ )) -done - -} always { - [[ -n $dounfunction ]] && (( $+functions[compadd] )) && unfunction compadd -} - -(( ret == 0 )) && return 0 - -compstate[pattern_match]="$opm" - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_arg_compile b/zsh_arm64/system/usr/share/zsh/functions/_arg_compile deleted file mode 100644 index e37c869..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_arg_compile +++ /dev/null @@ -1,199 +0,0 @@ -#autoload - -# A simple compiler for _arguments descriptions. The first argument of -# _arg_compile is the name of an array parameter in which the parse is -# returned. The remaining arguments form a series of `phrases'. Each -# `phrase' begins with one of the keywords "argument", "option", or "help" -# and consists of a series of keywords and/or values. The syntax is as -# free-form as possible, but "argument" phrases generally must appear in -# the same relative position as the corresponding argument on the command -# line to be completed, and there are some restrictions on ordering of -# keywords and values within each phrase. -# -# Anything appearing before the first phrase or after the last is passed -# through verbatim. (See TODO.) If more detailed mixing of compiled and -# uncompiled fragments is necessary, use two or more calls, either with -# different array names or by passing the output of each previous call -# through the next. -# -# In the documentation below, brackets [ ] indicate optional elements and -# braces { } indicate elements that may be repeated zero or more times. -# Except as noted, bracketed or braced elements may appear in any order -# relative to each other, but tokens within each element are ordered. -# -# argument [POS] [means MSG] [action ACT] -# -# POS may be an integer N for the Nth argument or "*" for all, and -# must appear first if it appears at all. -# MSG is a string to be displayed above the matches in a listing. -# ACT is (currently) as described in the compsys manual. -# -# option OPT [follow HOW] [explain STR] {unless XOR} \ -# {[means MSG] [action ACT]} [through PAT [means MSG] [action ACT]] -# -# OPT is the option, prefixed with "*" if it may appear more than once. -# HOW refers to a following argument, and may be one of: -# "close" must appear in the same word (synonyms "join" or "-") -# "next" the argument must appear in the next word (aka "split") -# "loose" the argument may appear in the same or the next word ("+") -# "assign" as loose, but must follow an "=" in the same word ("=") -# HOW should be suffixed with a colon if the following argument is -# _not_ required to appear. -# STR is to be displayed based on style `description' -# XOR is another option in combination with which OPT may not appear. -# It may be ":" to disable non-option completions when OPT is present. -# MSG is a string to be displayed above the matches in a listing. -# ACT is (currently) as described in the compsys manual. -# PAT is either "*" for "all remaining words on the line" or a pattern -# that, if matched, marks the end of the arguments of this option. -# The "through PAT ..." description must be the last. -# PAT may be suffixed with one colon to narrow the $words array to -# the remainder of the command line, or with two colons to narrow -# to the words before (not including) the next that matches PAT. -# -# help PAT [means MSG] action ACT -# -# ACT is applied to any option output by --help that matches PAT. -# Do not use "help" with commands that do not support --help. -# PAT may be suffixed with a colon if the following argument is -# _not_ required to appear (this is usually inferred from --help). -# MSG is a string to be displayed above the matches in a listing. - -# EXAMPLE: -# This is from _gprof in the standard distribution. Note that because of -# the brace expansion trick used in the "function name" case, no attempt -# is made to use `phrase' form; that part gets passed through unchanged. -# It could simply be moved to the _arguments call ahead of "$args[@]". -# -# _arg_compile args -s -{a,b,c,D,h,i,l,L,s,T,v,w,x,y,z} \ -# -{A,C,e,E,f,F,J,n,N,O,p,P,q,Q,Z}:'function name:->funcs' \ -# option -I means directory action _dir_list \ -# option -d follow close means "debug level" \ -# option -k means "function names" action '->pair' \ -# option -m means "minimum execution count" \ -# argument means executable action '_files -g \*\(-\*\)' \ -# argument means "profile file" action '_files -g gmon.\*' \ -# help '*=name*' means "function name" action '->funcs' \ -# help '*=dirs*' means "directory" action _dir_list -# _arguments "$args[@]" - -# TODO: -# Verbose forms of various actions, e.g. (but not exactly) -# "state foo" becomes "->foo" -# "completion X explain Y ..." becomes "((X\:Y ...))" -# etc. -# Represent leading "*" in OPT some other way. -# Represent trailing colons in HOW and PAT some other way. -# Stricter syntax checking on HOW, sanity checks on XOR. -# Something less obscure than "unless :" would be nice. -# Warning or other syntax check for stuff after the last phrase. - -emulate -L zsh -local -h argspec dspec helpspec prelude xor -local -h -A amap dmap safe - -[[ -n "$1" ]] || return 1 -[[ ${(tP)${1}} = *-local ]] && { print -R NAME CONFLICT: $1 1>&2; return 1 } -safe[reply]="$1"; shift - -# First consume and save anything before the argument phrases - -helpspec=() -prelude=() - -while (($#)) -do - case $1 in - (argument|help|option) break;; - (*) prelude=("$prelude[@]" "$1"); shift;; - esac -done - -# Consume all the argument phrases and build the argspec array - -while (($#)) -do - amap=() - dspec=() - case $1 in - - # argument [POS] [means MSG] [action ACT] - (argument) - shift - while (($#)) - do - case $1 in - (<1->|\*) amap[position]="$1"; shift;; - (means|action) amap[$1]="$2"; shift 2;; - (argument|option|help) break;; - (*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;; - esac - done - if (( $#amap )) - then - argspec=("$argspec[@]" "${amap[position]}:${amap[means]}:${amap[action]}") - fi;; - - # option OPT [follow HOW] [explain STR] {unless XOR} \ - # {[through PAT] [means MSG] [action ACT]} - (option) - amap[option]="$2"; shift 2 - dmap=() - xor=() - while (( $# )) - do - (( ${+amap[$1]} || ${+dmap[through]} )) && break; - case $1 in - (follow) - amap[follow]="${2:s/join/-/:s/close/-/:s/next//:s/split//:s/loose/+/:s/assign/=/:s/none//}" - shift 2;; - (explain) amap[explain]="[$2]" ; shift 2;; - (unless) xor=("$xor[@]" "${(@)=2}"); shift 2;; - (through|means|action) - while (( $# )) - do - (( ${+dmap[$1]} )) && break 2 - case $1 in - (through|means|action) dmap[$1]=":${2}"; shift 2;; - (argument|option|help|follow|explain|unless) break;; - (*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;; - esac - done;; - (argument|option|help) break;; - (*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;; - esac - if (( $#dmap )) - then - dspec=("$dspec[@]" "${dmap[through]}${dmap[means]:-:}${dmap[action]:-:}") - fi - done - if (( $#amap )) - then - argspec=("$argspec[@]" "${xor:+($xor)}${amap[option]}${amap[follow]}${amap[explain]}${dspec}") - fi;; - - # help PAT [means MSG] action ACT - (help) - amap[pattern]="$2"; shift 2 - while (($#)) - do - (( ${+amap[$1]} )) && break; - case $1 in - (means|action) amap[$1]="$2"; shift 2;; - (argument|option|help) break;; - (*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;; - esac - done - if (( $#amap )) - then - helpspec=("$helpspec[@]" "${amap[pattern]}:${amap[means]}:${amap[action]}") - fi;; - (*) break;; - esac -done - -eval $safe[reply]'=( "${prelude[@]}" "${argspec[@]}" ${helpspec:+"-- ${helpspec[@]}"} "$@" )' - -# print -R _arguments "${prelude[@]:q}" "${argspec[@]:q}" ${helpspec:+"-- ${helpspec[@]:q}"} "$@:q" - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_arguments b/zsh_arm64/system/usr/share/zsh/functions/_arguments deleted file mode 100644 index 136dd58..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_arguments +++ /dev/null @@ -1,587 +0,0 @@ -#autoload - -# Complete the arguments of the current command according to the -# descriptions given as arguments to this function. - -local long cmd="$words[1]" descr odescr mesg subopts opt opt2 usecc autod -local oldcontext="$curcontext" hasopts rawret optarg singopt alwopt -local setnormarg start rest -local -a match mbegin mend - -subopts=() -singopt=() -while [[ "$1" = -([AMO]*|[CRSWnsw]) ]]; do - case "$1" in - -C) usecc=yes; shift ;; - -O) subopts=( "${(@P)2}" ); shift 2 ;; - -O*) subopts=( "${(@P)${1[3,-1]}}" ); shift ;; - -R) rawret=yes; shift;; - -n) setnormarg=yes; NORMARG=-1; shift;; - -w) optarg=yes; shift;; - -W) alwopt=arg; shift;; - -[Ss]) singopt+=( $1 ); shift;; - -[AM]) singopt+=( $1 $2 ); shift 2 ;; - -[AM]*) singopt+=( $1 ); shift ;; - esac -done - -[[ $1 = ':' ]] && shift -singopt+=( ':' ) # always end with ':' to indicate the end of options - -[[ "$PREFIX" = [-+] ]] && alwopt=arg - -long=$argv[(I)--] -if (( long )); then - local name tmp tmpargv - - tmpargv=( "${(@)argv[1,long-1]}" ) # optspec's before --, if any - - name=${~words[1]} 2>/dev/null - [[ "$name" = [^/]*/* ]] && name="$PWD/$name" - - name="_args_cache_${name}" - name="${name//[^a-zA-Z0-9_]/_}" - - if (( ! ${(P)+name} )); then - local iopts sopts lflag pattern tmpo dir cur cache - typeset -Ua lopts - - cache=() - - # We have to build a new long-option cache, get the `-i' and - # `-s' options. - - set -- "${(@)argv[long+1,-1]}" - - iopts=() - sopts=() - while [[ "$1" = -[lis]* ]]; do - if [[ "$1" = -l ]]; then - lflag='-l' - shift - continue - fi - if [[ "$1" = -??* ]]; then - tmp="${1[3,-1]}" - cur=1 - else - tmp="$2" - cur=2 - fi - if [[ "$tmp[1]" = '(' ]]; then - tmp=( ${=tmp[2,-2]} ) - else - tmp=( "${(@P)tmp}" ) - fi - if [[ "$1" = -i* ]]; then - iopts+=( "$tmp[@]" ) - else - sopts+=( "$tmp[@]" ) - fi - shift cur - done - - # Now get the long option names by calling the command with `--help'. - # The parameter expansion trickery first gets the lines as separate - # array elements. Then we select all lines whose first non-blank - # character is a hyphen. Since some commands document more than one - # option per line, separated by commas, we convert commas into - # newlines and then split the result again at newlines after joining - # the old array elements with newlines between them. Then we select - # those elements that start with two hyphens, remove anything up to - # those hyphens and anything from the space or tab after the - # option up to the end. - - tmp=() - _call_program $lflag options ${~words[1]} --help 2>&1 | - while IFS= read -r opt; do - if (( ${#tmp} )); then - # Previous line had no comment. Is the current one suitable? - # It's hard to be sure, but if it there was nothing on the - # previous line and the current one is indented more than - # a couple of spaces (and isn't completely whitespace or punctuation) - # there's a pretty good chance. - if [[ $opt = [[:space:]][[:space:]][[:space:]]*[[:alpha:]]* ]]; then - # Assume so. - opt=${opt##[[:space:]]##} - # Same substitution as below. - lopts+=("${^tmp[@]}":${${${opt//:/-}//\[/(}//\]/)}) - tmp=() - # Finished with this line. - continue - else - # Still no comment, add the previous options anyway. - # Add a ':' after the option anyways, to make the matching of - # the options lateron work as intended. - # It will be removed again later. - lopts+=("${^tmp[@]}":) - tmp=() - fi - fi - while [[ $opt = [,[:space:]]#(#b)(-[^,[:space:]]#)(*) ]]; do - # We used to remove the brackets from "[=STUFF]", - # but later the code appears to handle it with the brackets - # present. Maybe the problem was that the intervening code - # didn't. If it's buggy without removing them, the problem - # probably is later, not here. - start=${match[1]} - rest=${match[2]} - if [[ -z ${tmp[(r)${start%%[^a-zA-Z0-9_-]#}]} ]]; then - # variant syntax seen in fetchmail: - # --[fetch]all means --fetchall or --all. - # maybe needs to be more general - if [[ $start = (#b)(*)\[(*)\](*) ]]; then - tmp+=("${match[1]}${match[2]}${match[3]}" "${match[1]}${match[3]}") - else - tmp+=($start) - fi - fi - opt=$rest - done - # If there's left over text, assume it's a description; it - # may be truncated but if it's too long it's no use anyway. - # There's one hiccup: we sometimes get descriptions like - # --foo fooarg Do some foo stuff with foo arg - # and we need to remove fooarg. Use whitespace for hints. - opt=${opt## [^[:space:]]## } - opt=${opt##[[:space:]]##} - if [[ -n $opt ]]; then - # Add description after a ":", converting any : in the description - # to a -. Use RCQUOTES to append this to all versions of the option. - lopts+=("${^tmp[@]}":${${${opt//:/-}//\[/(}//\]/)}) - tmp=() - # If there's no comment, we'll see if there's one on the - # next line. - fi - done - # Tidy up any remaining uncommented options. - if (( ${#tmp} )); then - lopts+=("${^tmp[@]}":) - fi - - # Remove options also described by user-defined specs. - - tmp=() - # Ignore any argument and description information when searching - # the long options array here and below. - for opt in "${(@)${(@)lopts:#--}%%[\[:=]*}"; do - - # Using (( ... )) gives a parse error. - - let "$tmpargv[(I)(|\([^\)]#\))(|\*)${opt}(|[-+]|=(|-))(|\[*\])(|:*)]" || - tmp+=( "$lopts[(r)$opt(|[\[:=]*)]" ) - done - lopts=( "$tmp[@]" ) - - # Now remove all ignored options ... - - while (( $#iopts )); do - lopts=( ${lopts:#$~iopts[1](|[\[:=]*)} ) - shift iopts - done - - # ... and add "same" options - - while (( $#sopts )); do - # This implements adding things like --disable-* based - # on the existence of --enable-*. - # TODO: there's no anchoring here, is that correct? - # If it's not, careful with the [\[:=]* stuff. - lopts+=( ${lopts/$~sopts[1]/$sopts[2]} ) - shift 2 sopts - done - - # Then we walk through the descriptions plus a few builtin ones. - # The last one matches all options; the `special' description and action - # makes those options be completed without an argument description. - - argv+=( - '*=FILE*:file:_files' - '*=(DIR|PATH)*:directory:_files -/' - '*=*:=: ' - '*: : ' - ) - - while (( $# )); do - - # First, we get the pattern and the action to use and take them - # from the positional parameters. - - # This is the first bit of the arguments in the special form - # for converting --help texts, taking account of any quoting - # of colons. - pattern="${${${(M)1#*[^\\]:}[1,-2]}//\\\\:/:}" - # Any action specifications that go with it. - descr="${1#${pattern}}" - if [[ "$pattern" = *\(-\) ]]; then - # This is the special form to disallow arguments - # in the next word. - pattern="$pattern[1,-4]" - dir=- - else - dir= - fi - shift - - # We get all options matching the pattern and take them from the - # list we have built. If no option matches the pattern, we - # continue with the next. - - # Ignore :descriptions at the ends of lopts for matching this; - # they aren't in the patterns. - tmp=("${(@M)lopts:##$~pattern:*}") - lopts=("${(@)lopts:##$~pattern:*}") - - (( $#tmp )) || continue - - opt='' - - # Clean suffix ':' added earlier - tmp=("${(@)tmp%:}") - - # If there are option strings with a `[=', we take these to get an - # optional argument. - - tmpo=("${(@M)tmp:#[^:]##\[\=*}") - if (( $#tmpo )); then - tmp=("${(@)tmp:#[^:]##\[\=*}") - - for opt in "$tmpo[@]"; do - # Look for --option:description and turn it into - # --option[description]. We didn't do that above - # since it could get confused with the [=ARG] stuff. - if [[ $opt = (#b)(*):([^:]#) ]]; then - opt=$match[1] - odescr="[${match[2]}]" - else - odescr= - fi - if [[ $opt = (#b)(*)\[\=* ]]; then - opt2=${${match[1]}//[^a-zA-Z0-9_-]}=-${dir}${odescr} - else - opt2=${${opt}//[^a-zA-Z0-9_-]}=${dir}${odescr} - fi - if [[ "$descr" = :\=* ]]; then - cache+=( "${opt2}::${(L)${opt%\]}#*\=}: " ) - elif [[ "$descr" = ::* ]]; then - cache+=( "${opt2}${descr}" ) - else - cache+=( "${opt2}:${descr}" ) - fi - done - fi - - # Descriptions with `=': mandatory argument. - # Basically the same as the foregoing. - # TODO: could they be combined? - - tmpo=("${(@M)tmp:#[^:]##\=*}") - if (( $#tmpo )); then - tmp=("${(@)tmp:#[^:]##\=*}") - - for opt in "$tmpo[@]"; do - if [[ $opt = (#b)(*):([^:]#) ]]; then - opt=$match[1] - odescr="[${match[2]}]" - else - odescr= - fi - opt2="${${opt%%\=*}//[^a-zA-Z0-9_-]}=${dir}${odescr}" - if [[ "$descr" = :\=* ]]; then - cache+=( "${opt2}:${(L)${opt%\]}#*\=}: " ) - else - cache+=( "${opt2}${descr}" ) - fi - done - fi - - # Everything else is just added as an option without arguments or - # as described by $descr. - - if (( $#tmp )); then - tmp=( - # commands with a description of the option (as opposed - # to the argument, which is what descr contains): needs to be - # "option[description]". - # Careful: \[ on RHS of substitution keeps the backslash, - # I discovered after about half an hour, so don't do that. - "${(@)^${(@)tmp:#^*:*}//:/[}]" - # commands with no description - "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9_-]}") - if [[ -n "$descr" && "$descr" != ': : ' ]]; then - cache+=( "${(@)^tmp}${descr}" ) - else - cache+=( "$tmp[@]" ) - fi - fi - done - set -A "$name" "${(@)cache:# #}" - fi - set -- "$tmpargv[@]" "${(@P)name}" -fi - -zstyle -s ":completion:${curcontext}:options" auto-description autod - -if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then - local action noargs aret expl local tried ret=1 - local next direct odirect equal single matcher matched ws tmp1 tmp2 tmp3 - local opts subc tc prefix suffix descrs actions subcs anum - local origpre="$PREFIX" origipre="$IPREFIX" nm="$compstate[nmatches]" - - if comparguments -D descrs actions subcs; then - if comparguments -O next direct odirect equal; then - opts=yes - _tags "$subcs[@]" options - else - _tags "$subcs[@]" - fi - else - if comparguments -a; then - noargs='no more arguments' - else - noargs='no arguments' - fi - if comparguments -O next direct odirect equal; then - opts=yes - _tags options - elif [[ $? -eq 2 ]]; then - compadd -Q - "${PREFIX}${SUFFIX}" - return 0 - else - _message "$noargs" - return 1 - fi - fi - - comparguments -M matcher - - context=() - state=() - state_descr=() - - while true; do - while _tags; do - anum=1 - if [[ -z "$tried" ]]; then - while [[ anum -le $#descrs ]]; do - - action="$actions[anum]" - descr="$descrs[anum]" - subc="$subcs[anum++]" - - if [[ $subc = argument* && -n $setnormarg ]]; then - comparguments -n NORMARG - fi - - if [[ -n "$matched" ]] || _requested "$subc"; then - - curcontext="${oldcontext%:*}:$subc" - - _description "$subc" expl "$descr" - - if [[ "$action" = \=\ * ]]; then - action="$action[3,-1]" - words=( "$subc" "$words[@]" ) - (( CURRENT++ )) - fi - - if [[ "$action" = -\>* ]]; then - action="${${action[3,-1]##[ ]#}%%[ ]#}" - if (( ! $state[(I)$action] )); then - comparguments -W line opt_args - state+=( "$action" ) - state_descr+=( "$descr" ) - if [[ -n "$usecc" ]]; then - curcontext="${oldcontext%:*}:$subc" - else - context+=( "$subc" ) - fi - compstate[restore]='' - aret=yes - fi - else - if [[ -z "$local" ]]; then - local line - typeset -A opt_args - local=yes - fi - - comparguments -W line opt_args - - if [[ "$action" = \ # ]]; then - - # An empty action means that we should just display a message. - - _message -e "$subc" "$descr" - mesg=yes - tried=yes - alwopt=${alwopt:-yes} - elif [[ "$action" = \(\(*\)\) ]]; then - - # ((...)) contains literal strings with descriptions. - - eval ws\=\( "${action[3,-3]}" \) - - _describe -t "$subc" "$descr" ws -M "$matcher" "$subopts[@]" || - alwopt=${alwopt:-yes} - tried=yes - - elif [[ "$action" = \(*\) ]]; then - - # Anything inside `(...)' is added directly. - - eval ws\=\( "${action[2,-2]}" \) - - _all_labels "$subc" expl "$descr" compadd "$subopts[@]" -a - ws || - alwopt=${alwopt:-yes} - tried=yes - elif [[ "$action" = \{*\} ]]; then - - # A string in braces is evaluated. - - while _next_label "$subc" expl "$descr"; do - eval "$action[2,-2]" && ret=0 - done - (( ret )) && alwopt=${alwopt:-yes} - tried=yes - elif [[ "$action" = \ * ]]; then - - # If the action starts with a space, we just call it. - - eval "action=( $action )" - while _next_label "$subc" expl "$descr"; do - "$action[@]" && ret=0 - done - (( ret )) && alwopt=${alwopt:-yes} - tried=yes - else - - # Otherwise we call it with the description-arguments. - - eval "action=( $action )" - while _next_label "$subc" expl "$descr"; do - "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}" && ret=0 - done - (( ret )) && alwopt=${alwopt:-yes} - tried=yes - fi - fi - fi - done - fi - if _requested options && - [[ -z "$hasopts" && - -z "$matched" && - ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] && - { ! zstyle -T ":completion:${oldcontext%:*}:options" prefix-needed || - [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then - local prevpre="$PREFIX" previpre="$IPREFIX" prevcontext="$curcontext" - - curcontext="${oldcontext%:*}:options" - - hasopts=yes - - PREFIX="$origpre" - IPREFIX="$origipre" - - if [[ -z "$alwopt" || -z "$tried" || "$alwopt" = arg ]] && - comparguments -s single; then - - if [[ "$single" = direct ]]; then - _all_labels options expl option \ - compadd -QS '' - "${PREFIX}${SUFFIX}" - elif [[ -z "$optarg" && "$single" = next ]]; then - _all_labels options expl option \ - compadd -Q - "${PREFIX}${SUFFIX}" - elif [[ "$single" = equal ]]; then - _all_labels options expl option \ - compadd -QqS= - "${PREFIX}${SUFFIX}" - else - - tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" ) - - [[ "$PREFIX" = [-+]* ]] && tmp1=( "${(@M)tmp1:#${PREFIX[1]}*}" ) - - [[ "$single" = next ]] && - tmp1=( "${(@)tmp1:#[-+]${PREFIX[-1]}((#e)|:*)}" ) - - [[ "$PREFIX" != --* ]] && tmp1=( "${(@)tmp1:#--*}" ) - tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" ) - tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" ) - tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" ) - - _describe -O option \ - tmp1 tmp2 -Q -S '' -- \ - tmp3 -Q - - [[ -n "$optarg" && "$single" = next && nm -eq $compstate[nmatches] ]] && - _all_labels options expl option \ - compadd -Q - "${PREFIX}${SUFFIX}" - - fi - single=yes - else - next+=( "$odirect[@]" ) - _describe -O option \ - next -Q -M "$matcher" -- \ - direct -QS '' -M "$matcher" -- \ - equal -QqS= -M "$matcher" - fi - PREFIX="$prevpre" - IPREFIX="$previpre" - curcontext="$prevcontext" - fi - [[ -n "$tried" && "${${alwopt:+$origpre}:-$PREFIX}" != [-+]* ]] && break - done - if [[ -n "$opts" && -z "$aret" && - -z "$matched" && - ( -z "$tried" || -n "$alwopt" ) && - nm -eq compstate[nmatches] ]]; then - - PREFIX="$origpre" - IPREFIX="$origipre" - - prefix="${PREFIX#*\=}" - suffix="$SUFFIX" - PREFIX="${PREFIX%%\=*}" - SUFFIX='' - - compadd -M "$matcher" -D equal - "${(@)equal%%:*}" - - if [[ $#equal -eq 1 ]]; then - PREFIX="$prefix" - SUFFIX="$suffix" - IPREFIX="${IPREFIX}${equal[1]%%:*}=" - matched=yes - - comparguments -L "${equal[1]%%:*}" descrs actions subcs - - _tags "$subcs[@]" - - continue - fi - fi - break - done - - [[ -z "$aret" || -z "$usecc" ]] && curcontext="$oldcontext" - - if [[ -n "$aret" ]]; then - [[ -n $rawret ]] && return 300 - -### Returning non-zero would allow the calling function to add its own -### completions if we generated only options and have to use a ->state -### action. But if that then doesn't generate matches, the calling -### function's return value would be wrong unless it compares -### $compstate[nmatches] to its previous value. Ugly. -### -### return 1 - else - [[ -n "$noargs" && nm -eq "$compstate[nmatches]" ]] && _message "$noargs" - fi - # Set the return value. - - [[ nm -ne "$compstate[nmatches]" ]] -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_arrays b/zsh_arm64/system/usr/share/zsh/functions/_arrays deleted file mode 100644 index c28fb17..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_arrays +++ /dev/null @@ -1,5 +0,0 @@ -#compdef shift - -local expl - -_wanted arrays expl array _parameters "$@" -g '*array*' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_assign b/zsh_arm64/system/usr/share/zsh/functions/_assign deleted file mode 100644 index 4935cc9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_assign +++ /dev/null @@ -1,3 +0,0 @@ -#compdef -assign-parameter- - -_parameters -g "^*readonly*" -S '' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_autocd b/zsh_arm64/system/usr/share/zsh/functions/_autocd deleted file mode 100644 index 58ba5b1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_autocd +++ /dev/null @@ -1,5 +0,0 @@ -#compdef -command- - -_command_names -local ret=$? -[[ -o autocd ]] && _cd || return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_bash_completions b/zsh_arm64/system/usr/share/zsh/functions/_bash_completions deleted file mode 100644 index 7abb654..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_bash_completions +++ /dev/null @@ -1,46 +0,0 @@ -#compdef -K _bash_complete-word complete-word \e~ _bash_list-choices list-choices ^X~ -# -# This function is for bash compatibility. As some of the bash bindings -# are already taken up in zsh, only Esc ~ and \C-x ~ are bound, and -# you must add the rest by hand. The bindings expected are: -# -# Esc ! -> command name -# Esc $ -> environment variables -# Esc @ -> machine names -# Esc / -> file name -# Esc ~ -> a user name -# -# C-x instead of Esc with one of the above will list matches and won't -# attempt any completion. -# -# The following will bind the remaining set; simply put it in .zshrc -# after compinit is run. -# -# for key in '!' '$' '@' '/'; do -# bindkey "\e$key" _bash_complete-word -# bindkey "^X$key" _bash_list-choices -# done -# -# If for some reason \e~ or ^X~ were already bound to something else, -# that will not have been overridden, so you should add '~' to the -# list of keys at the top of the for-loop. - -eval "$_comp_setup" - -local key=$KEYS[-1] expl - -case $key in - '!') _main_complete _command_names - ;; - '$') _main_complete - parameters _wanted parameters expl 'exported parameters' \ - _parameters -g '*export*' - ;; - '@') _main_complete _hosts - ;; - '/') _main_complete _files - ;; - '~') _main_complete _users - ;; - *) _message "Key $key is not understood" - ;; -esac diff --git a/zsh_arm64/system/usr/share/zsh/functions/_bindkey b/zsh_arm64/system/usr/share/zsh/functions/_bindkey deleted file mode 100644 index 81ae699..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_bindkey +++ /dev/null @@ -1,38 +0,0 @@ -#compdef bindkey - -# Normally, this completes names of zle widgets, whether the builtin ones -# or ones defined by the user. Note that a - allows a wildcard before it, -# so h-b-s-b will complete to history-beginning-search-backward. You -# can alter this by removing the -M ... from the second compadd. -# -# Where appropriate, will complete keymaps instead of widgets. - -local state expl line curcontext="$curcontext" ret=1 -typeset -A opt_args - -_arguments -C -s -S \ - '(-v -a -M -l -D -A -N -p)-e[select emacs keymap and bind it to main]' \ - '(-e -a -M -l -D -A -N -p)-v[select viins keymap and bind it to main]' \ - '(-e -v -M -l -D -A -N -p)-a[select vicmd keymap]' \ - '(-e -v -a -l -D -A -N)-M[specify keymap to select]:keymap:->keymap' \ - '(-e -v -a -M -D -A -N -m -p -r -s -R *)-l[list existing keymap names]' \ - '(-e -v -a -d -A -N -m -r -s -R *)-L[output in form of bindkey commands]' \ - '(-e -v -a -l -D -A -N -m -p -r -s -R *)-d[delete existing keymaps and reset to default state]' \ - '(-e -v -a -M -l -d -A -N -m -p -r -s -R *)-D[delete named keymaps]:*:keymap:->keymap' \ - '(-e -v -a -M -l -L -d -D -N -m -p -r -s -R *)-A[create alias to keymap]:old-keymap:->keymap:new-keymap:->keymap' \ - '(-e -v -a -M -l -L -d -D -A -m -p -r -s -R *)-N[create new keymap]:new-keymap:->keymap:old-keymap to copy:->keymap' \ - '(-l -L -d -D -A -N -p -r -s -r -R *)-m[add builtin meta-key bindings to selected keymap]' \ - '(-e -v -a -d -D -A -N -m -s -R *)-p[list bindings which have given key sequence as a prefix]:key sequence' \ - '(-l -L -d -D -A -N -m -s *)-r[unbind specified in-strings]:*:in-string' \ - '(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \ - '(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \ - '(-l -L -d -A -N -m -p -r -s):in-string' \ - '(-l -L -d -A -N -m -p -r -s)*::widgets:_widgets' && ret=0 - -case $state in - keymap) - _wanted keymaps expl keymap compadd -a keymaps && ret=0 - ;; -esac - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_brace_parameter b/zsh_arm64/system/usr/share/zsh/functions/_brace_parameter deleted file mode 100644 index a9ab44e..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_brace_parameter +++ /dev/null @@ -1,212 +0,0 @@ -#compdef -brace-parameter- - -local char delim found_percent found_m exp -local -a flags -integer q_last n_q - -if [[ $PREFIX = *'${('[^\)]# ]]; then - # Parameter flags. - compset -p 3 - - # Based on code in _globquals. - while [[ -n $PREFIX ]]; do - char=$PREFIX[1] - compset -p 1 - if [[ $char = q ]]; then - (( q_last++, n_q++ )) - continue - else - (( q_last = 0 )) - fi - # Skip arguments to find what's left to complete - case $char in - (%) - found_percent=1 - ;; - - (m) - found_m=1 - ;; - - ([gIjsZ_]) - # Single delimited argument. - if [[ -z $PREFIX ]]; then - _delimiters qualifier-$char - return - elif ! _globqual_delims; then - # still completing argument - case $char in - (g) - compset -P '*' - flags=('o:octal escapes' 'c:expand ^X etc.' 'e:expand \M-t etc.') - _describe -t format 'format option' flags -Q -S '' - ;; - - (I) - _message 'integer expression' - ;; - - ([js]) - _message "separator" - ;; - - (Z) - compset -P '*' - flags=( - 'c:parse comments as strings (else as ordinary words)' - 'C:strip comments (else treat as ordinary words)' - 'n:treat newlines as whitespace' - ) - _describe -t format 'format option' flags -Q -S '' - ;; - - (_) - _message "no useful values" - ;; - esac - return - fi - ;; - - ([lr]) - # One compulsory argument, two optional. - if [[ -z $PREFIX ]]; then - _delimiters qualifier-$char - return - else - delim=$PREFIX[1] - if ! _globqual_delims; then - # still completing argument - _message "padding width" - return - fi - # TBD if $PREFIX is empty can complete - # either repeat delimiter or a new qualifier. - # You might think it would just be easier - # for the user to type the delimiter at - # this stage, but users are astonishingly lazy. - if [[ $delim = $PREFIX[1] ]]; then - # second argument - if ! _globqual_delims; then - _message "repeated padding" - return - fi - if [[ $delim = $PREFIX[1] ]]; then - if ! _globqual_delims; then - _message "one-off padding" - return - fi - fi - fi - fi - ;; - esac - done - - if [[ -z $found_percent ]]; then - flags=("%:expand prompt sequences") - else - flags=("%:expand prompts respecting options") - fi - case $q_last in - (0) - if (( n_q == 0 )); then - flags+=("q:quote with backslashes") - fi - ;; - - (1) - flags+=( - "q:quote with single quotes" - "-:quote minimally for readability" - "+:quote like q-, plus \$'...' for unprintable characters" - ) - ;; - - (2) - flags+=("q:quote with double quotes") - ;; - - (3) - flags+=("q:quote with \$'...'") - ;; - esac - if (( !n_q )); then - flags+=("Q:remove one level of quoting") - fi - if [[ -z $found_m ]]; then - flags+=("m:count multibyte width in padding calculation") - else - flags+=("m:count number of character code points in padding calculation") - fi - flags+=( - "#:evaluate as numeric expression" - "@:prevent double-quoted joining of arrays" - "A:assign as an array parameter" - "a:sort in array index order (with O to reverse)" - "b:backslash quote pattern characters only" - "c:count characters in an array (with \${(c)#...})" - "C:capitalize words" - "D:perform directory name abbreviation" - "e:perform single-word shell expansions" - "f:split the result on newlines" - "F:join arrays with newlines" - "g:process echo array sequences (needs options)" - "i:sort case-insensitively" - "k:substitute keys of associative arrays" - "L:lower case all letters" - "n:sort decimal integers numerically" - "o:sort in ascending order (lexically if no other sort option)" - "O:sort in descending order (lexically if no other sort option)" - "P:use parameter value as name of parameter for redirected lookup" - "t:substitute type of parameter" - "u:substitute first occurrence of each unique word" - "U:upper case all letters" - "v:substitute values of associative arrays (with (k))" - "V:visibility enhancements for special characters" - "w:count words in array or string (with \${(w)#...})" - "W:count words including empty words (with \${(W)#...})" - "X:report parsing errors and eXit substitution" - "z:split words as if zsh command line" - "0:split words on null bytes" - "p:handle print escapes or variables in parameter flag arguments" - "~:treat strings in parameter flag arguments as patterns" - "j:join arrays with specified string" - "l:left-pad resulting words" - "r:right-pad resulting words" - "s:split words on specified string" - "Z:split words as if zsh command line (with options)" - # "_:extended flags, for future expansion" - "S:search substrings in #, %, / expressions" - "I:search th match in #, %, / expressions" - "B:include index of beginning of match in #, % expressions" - "E:include index of one past end of match in #, % expressions" - "M:include matched portion in #, % expressions" - "N:include length of match in #, % expressions" - "R:include rest (unmatched portion) in #, % expressions" - ) - _describe -t flags "parameter flag" flags -Q -S '' - return -elif compset -P '*:([\|\*\^]|\^\^)'; then - _arrays - return -elif compset -P '*:'; then - flags=( - '-:substitute alternate value if parameter is null' - '+:substitute alternate value if parameter is non-null' - '=:substitute and assign alternate value if parameter is null' - '\:=:unconditionally assign value to parameter' - '?:print error if parameter is null' - '#:filter value matching pattern' - '/:replace whole word matching pattern' - '|:set difference' - '*:set intersection' - '^:zip arrays' - '^^:zip arrays reusing values from shorter array' - ) - _describe -t flags "operator" flags -Q -S '' - _history_modifiers p - return -fi - -_parameters -e diff --git a/zsh_arm64/system/usr/share/zsh/functions/_builtin b/zsh_arm64/system/usr/share/zsh/functions/_builtin deleted file mode 100644 index 9fb6acf..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_builtin +++ /dev/null @@ -1,11 +0,0 @@ -#compdef builtin - -if (( $CURRENT > 2 )); then - shift words - (( CURRENT -- )) - _normal -else - local expl - - _wanted commands expl 'builtin command' compadd "$@" -k builtins -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_cache_invalid b/zsh_arm64/system/usr/share/zsh/functions/_cache_invalid deleted file mode 100644 index e553814..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_cache_invalid +++ /dev/null @@ -1,21 +0,0 @@ -#autoload -# -# Function to decide whether a completions cache needs rebuilding - -local _cache_ident _cache_dir _cache_path _cache_policy -_cache_ident="$1" - -# If the cache is disabled, we never want to rebuild it, so pretend -# it's valid. -zstyle -t ":completion:${curcontext}:" use-cache || return 1 - -zstyle -s ":completion:${curcontext}:" cache-path _cache_dir -: ${_cache_dir:=${ZDOTDIR:-$HOME}/.zcompcache} -_cache_path="$_cache_dir/$_cache_ident" - -# See whether the caching policy says that the cache needs rebuilding -# (the policy will return 0 if it does). -zstyle -s ":completion:${curcontext}:" cache-policy _cache_policy -[[ -n "$_cache_policy" ]] && "$_cache_policy" "$_cache_path" && return 0 - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_call_function b/zsh_arm64/system/usr/share/zsh/functions/_call_function deleted file mode 100644 index 342f350..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_call_function +++ /dev/null @@ -1,32 +0,0 @@ -#autoload - -# Utility function to call a function if it exists. -# -# Usage: _call_function [ ... ] -# -# If a function named is defined (or defined to be autoloaded), -# it is called. If is given not the string `-' or empty, it is -# taken as the name of a parameter and the return status of the function -# called is stored in this parameter. All other arguments are given -# to the function called. -# The return value of this function is zero if the function was -# called and non-zero otherwise. - -local _name _ret - -[[ "$1" != (|-) ]] && _name="$1" - -shift - -if (( $+functions[$1] )); then - "$@" - _ret="$?" - - [[ -n "$_name" ]] && eval "${_name}=${_ret}" - - compstate[restore]='' - - return 0 -fi - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_call_program b/zsh_arm64/system/usr/share/zsh/functions/_call_program deleted file mode 100644 index 73f3ef6..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_call_program +++ /dev/null @@ -1,39 +0,0 @@ -#autoload +X - -local curcontext="${curcontext}" tmp err_fd=-1 clocale='_comp_locale;' -local -a prefix - -if [[ "$1" = -p ]]; then - shift - if (( $#_comp_priv_prefix )); then - curcontext="${curcontext%:*}/${${(@M)_comp_priv_prefix:#^*[^\\]=*}[1]}:" - zstyle -t ":completion:${curcontext}:${1}" gain-privileges && - prefix=( $_comp_priv_prefix ) - fi -elif [[ "$1" = -l ]]; then - shift - clocale='' -fi - -if (( ${debug_fd:--1} > 2 )) || [[ ! -t 2 ]] -then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is trace or redirect -else exec {err_fd}>/dev/null -fi - -{ # Begin "always" block - -if zstyle -s ":completion:${curcontext}:${1}" command tmp; then - if [[ "$tmp" = -* ]]; then - eval $clocale "$tmp[2,-1]" "$argv[2,-1]" - else - eval $clocale $prefix "$tmp" - fi -else - eval $clocale $prefix "$argv[2,-1]" -fi 2>&$err_fd - -} always { - -exec {err_fd}>&- - -} diff --git a/zsh_arm64/system/usr/share/zsh/functions/_cd b/zsh_arm64/system/usr/share/zsh/functions/_cd deleted file mode 100644 index 46237e7..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_cd +++ /dev/null @@ -1,118 +0,0 @@ -#compdef cd chdir pushd - -# Handling of cd. -# - Normally just completes directories. Uses cdpath if that's set -# and the string doesn't begin with ~, /, ./ or ../. -# - In the second argument to cd for the form `cd old new', completes -# possible `new' strings by examining `old' and $PWD. -# - After - or +, _directory_stack completes numbers, but the listing -# gives you the list of directories to complete. This turns on -# menu-completion and lists the possibilities automatically, otherwise -# it's not a lot of use. If you don't type the + or - it will -# complete directories as normal. - -_cd_options() { - _arguments -s \ - '-q[quiet, no output or use of hooks]' \ - '-s[refuse to use paths with symlinks]' \ - '(-P)-L[retain symbolic links ignoring CHASE_LINKS]' \ - '(-L)-P[resolve symbolic links as CHASE_LINKS]' -} - -setopt localoptions nonomatch - -local expl ret=1 curarg -integer argstart=2 noopts match mbegin mend - -if (( CURRENT > 1 )); then - # if not in command position, may have options. - # Careful: -<-> is not an option. - while [[ $words[$argstart] = -* && argstart -lt CURRENT ]]; do - curarg=$words[$argstart] - [[ $curarg = -<-> ]] && break - (( argstart++ )) - [[ $curarg = -- ]] && noopts=1 && break - done -fi - -if [[ CURRENT -eq $((argstart+1)) ]]; then - # cd old new: look for old in $PWD and see what can replace it - local rep - # Get possible completions using word in position 2 - rep=(${~PWD/$words[$argstart]/*}~$PWD(-/)) - # Now remove all the common parts of $PWD and the completions from this - rep=(${${rep#${PWD%%$words[$argstart]*}}%${PWD#*$words[$argstart]}}) - (( $#rep )) && _wanted -C replacement strings expl replacement compadd -a rep -else - # Complete directory stack entries with ~ or when not in command position - # (the rest of this test is optimization for the _tilde call below) - if [[ "$PREFIX" == (#b)(\~|)[^/]# && - ( -n "$match[1]" || ( CURRENT -gt 1 && ! -o cdablevars ) ) ]]; then - _directory_stack && ret=0 - fi - - local -a tmpWpath - if [[ $PREFIX = (|*/)../* ]]; then - local tmpprefix - # Use cd in a subshell to properly [not] resolve symlinks - tmpprefix=$(cd ${PREFIX%/*} >&/dev/null && print $PWD) - if [[ -n $tmpprefix ]]; then - tmpWpath=(-W $tmpprefix) - IPREFIX=${IPREFIX}${PREFIX%/*}/ - PREFIX=${PREFIX##*/} - fi - fi - - if [[ $PREFIX != (\~|/|./|../)* && $IPREFIX != ../* ]]; then - local tmpcdpath alt - - alt=() - - tmpcdpath=(${${(@)cdpath:#.}:#$PWD}) - - (( $#tmpcdpath )) && - alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' ) - - # With cdablevars, we can complete foo as if ~foo/ - if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" != <-> ]]; then - if [[ "$PREFIX" != */* ]]; then - alt=( "$alt[@]" 'named-directories: : _tilde' ) - else - local oipre="$IPREFIX" opre="$PREFIX" dirpre dir - - # Note we need a tilde because cdablevars also allows user home - # directories, hence nonomatch (above) to suppress error messages. - - dirpre="${PREFIX%%/*}/" - IPREFIX="$IPREFIX$dirpre" - eval "dir=( ~$dirpre )" - PREFIX="${PREFIX#*/}" - - [[ $#dir -eq 1 && "$dir[1]" != "~$dirpre" ]] && - _wanted named-directories expl 'directory after cdablevar' \ - _path_files -W dir -/ && ret=0 - - PREFIX="$opre" - IPREFIX="$oipre" - fi - fi - # Don't complete local directories in command position, that's - # already handled by _command_names (see _autocd) - - [[ CURRENT -ne 1 || ( -z "$path[(r).]" && $PREFIX != */* ) ]] && - alt=( "${cdpath+local-}directories:${cdpath+local }directory:_path_files ${(j: :)${(@q)tmpWpath}} -/" "$alt[@]" ) - - if [[ CURRENT -eq argstart && noopts -eq 0 && $PREFIX = -* ]] && - zstyle -t ":completion:${curcontext}:options" complete-options; then - alt=("$service-options:$service option:_cd_options" "$alt[@]") - fi - - _alternative "$alt[@]" && ret=0 - - return ret - fi - [[ CURRENT -ne 1 ]] && _wanted directories expl directory \ - _path_files $tmpWpath -/ && ret=0 - - return ret -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_cdr b/zsh_arm64/system/usr/share/zsh/functions/_cdr deleted file mode 100644 index 3a1e9bd..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_cdr +++ /dev/null @@ -1,57 +0,0 @@ -#compdef cdr - -local expl insert_string -integer default insert - -zstyle -t ':chpwd:' recent-dirs-default && default=1 -if (( default )); then - zstyle -s ":completion:${curcontext}:" recent-dirs-insert insert_string - case $insert_string in - (both) - insert=4 - ;; - - (fallback) - insert=3 - ;; - - (always) - insert=2 - ;; - - ([tT]*|1|[yY]*) - insert=1 - ;; - - (*) - insert=0 - esac -fi - -# See if we should fall back to cd completion. -if [[ default -ne 0 && insert -lt 2 && \ - ( CURRENT -ne 2 || (-n $words[2] && $words[2] != <->) ) ]]; then - $_comps[cd] "$@" - return -fi - -local -a values keys - -if (( insert )); then - # insert the actual directory, not the number - values=(${${(f)"$(cdr -l)"}##<-> ##}) - # Suppress the usual space suffix, since there's no further argument - # and it's useful to be able to edit the directory e.g. add /more/stuff. - if _wanted -V recent-dirs expl 'recent directory' compadd -S '' -Q -a values - then - (( insert == 4 )) || return 0 - fi - - (( insert >= 3 )) || return - $_comps[cd] "$@" -else - values=(${${(f)"$(cdr -l)"}/ ##/:}) - keys=(${values%%:*}) - - _describe -t dir-index 'recent directory index' values keys -V unsorted -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_combination b/zsh_arm64/system/usr/share/zsh/functions/_combination deleted file mode 100644 index 5e87b31..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_combination +++ /dev/null @@ -1,102 +0,0 @@ -#autoload - -# Usage: -# _combination [-s S] TAG STYLE \ -# Ki1[:Ni1]=Pi1 Ki2[:Ni2]=Pi2 ... Kim[:Nim]=Pim Kj[:Nj] EXPL... -# -# STYLE should be of the form K1-K2-...-Kn. -# -# Example: telnet -# -# Assume a user sets the style `users-hosts-ports' as for the my-accounts -# tag: -# -# zstyle ':completion:*:*:telnet:*:my-accounts' users-hosts-ports \ -# @host0: user1@host1: user2@host2: -# @mail-server:{smtp,pop3} -# @news-server:nntp -# @proxy-server:8000 -# -# -# `_telnet' completes hosts as: -# -# _combination my-accounts users-hosts-ports \ -# ${opt_args[-l]:+users=${opt_args[-l]:q}} \ -# hosts "$expl[@]" -# -# This completes `host1', `host2', `mail-server', `news-server' and -# `proxy-server' according to the user given with `-l' if it is exists. -# And if it is failed, `_hosts' is called. -# -# `_telnet' completes ports as: -# -# _combination my-accounts users-hosts-ports \ -# ${opt_args[-l]:+users=${opt_args[-l]:q}} \ -# hosts="${line[2]:q}" \ -# ports "$expl[@]" -# -# This completes `smtp', `pop3', `nntp' and `8000' according to the -# host argument --- $line[2] and the user option argument if it is -# exists. And if it is failed, `_ports' is called. -# -# `_telnet' completes users for an argument of option `-l' as: -# -# _combination my-accounts users-hosts-ports \ -# ${line[2]:+hosts="${line[2]:q}"} \ -# ${line[3]:+ports="${line[3]:q}"} \ -# users "$expl[@]" -# -# This completes `user1' and `user2' according to the host argument and -# the port argument if they are exist. And if it is failed, `_users' is -# called. - -local sep tag style keys pats key num tmp - -if [[ "$1" = -s ]]; then - sep="$2" - shift 2 -elif [[ "$1" = -s* ]]; then - sep="${1[3,-1]}" - shift -else - sep=: -fi - -tag="$1" -style="$2" -shift 2 - -keys=( ${(s/-/)style} ) -pats=( "${(@)keys/*/*}" ) - -while [[ "$1" = *=* ]]; do - tmp="${1%%\=*}" - key="${tmp%:*}" - if [[ $1 = *:* ]]; then - num=${tmp##*:} - else - num=1 - fi - pats[$keys[(in:num:)$key]]="${1#*\=}" - shift -done - -key="${1%:*}" -if [[ $1 = *:* ]]; then - num=${1##*:} -else - num=1 -fi -shift - -if zstyle -a ":completion:${curcontext}:$tag" "$style" tmp; then - eval "tmp=( \"\${(@M)tmp:#\${(j($sep))~pats}}\" )" - if (( keys[(in:num:)$key] != 1 )); then - eval "tmp=( \${tmp#\${(j(${sep}))~\${(@)\${(@)keys[2,(rn:num:)\$key]}/*/*}}${~sep}} )" - fi - tmp=( ${tmp%%${~sep}*} ) - - compadd "$@" -a tmp || { (( $+functions[_$key] )) && "_$key" "$@" } -else - (( $+functions[_$key] )) && "_$key" "$@" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_command b/zsh_arm64/system/usr/share/zsh/functions/_command deleted file mode 100644 index 4e28586..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_command +++ /dev/null @@ -1,11 +0,0 @@ -#compdef command - -# indicate if this is a precommand modifier -[[ $service = command ]] && precommands+=(command) - -_arguments \ - '-v[indicate result of command search]:*:command:_path_commands' \ - '-V[show result of command search in verbose form]:*:command:_path_commands' \ - '(-)-p[use default PATH to find command]' \ - ':command:_path_commands' \ - '*::arguments: _normal' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_command_names b/zsh_arm64/system/usr/share/zsh/functions/_command_names deleted file mode 100644 index f818877..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_command_names +++ /dev/null @@ -1,49 +0,0 @@ -#autoload - -# The option `-e' if given as the first argument says that we should -# complete only external commands and executable files. This and a -# `-' as the first argument is then removed from the arguments. - -local args defs ffilt - -zstyle -t ":completion:${curcontext}:commands" rehash && rehash - -zstyle -t ":completion:${curcontext}:functions" prefix-needed && \ - [[ $PREFIX != [_.]* ]] && \ - ffilt='[(I)[^_.]*]' - -defs=( - 'commands:external command:_path_commands' -) - -[[ -n "$path[(r).]" || $PREFIX = */* ]] && - defs+=( 'executables:executable file:_files -g \*\(-\*\)' ) - -if [[ "$1" = -e ]]; then - shift -else - [[ "$1" = - ]] && shift - - defs=( "$defs[@]" - 'builtins:builtin command:compadd -Qk builtins' - "functions:shell function:compadd -k 'functions$ffilt'" - 'aliases:alias:compadd -Qk aliases' - 'suffix-aliases:suffix alias:_suffix_alias_files' - 'reserved-words:reserved word:compadd -Qk reswords' - 'jobs:: _jobs -t' - 'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"' - 'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"' - ) -fi - -args=( "$@" ) - -local -a cmdpath -if zstyle -a ":completion:${curcontext}" command-path cmdpath && - [[ $#cmdpath -gt 0 ]] -then - local -a +h path - local -A +h commands - path=( $cmdpath ) -fi -_alternative -O args "$defs[@]" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_comp_locale b/zsh_arm64/system/usr/share/zsh/functions/_comp_locale deleted file mode 100644 index e55338b..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_comp_locale +++ /dev/null @@ -1,20 +0,0 @@ -#autoload - -# Arrange that LC_CTYPE retains the current setting so characters in -# file names are handled properly, but other locales are set to C so -# that the completion system can process output without surprises. - -# This exports new locale settings, so should only -# be run in a subshell. A typical use is in a $(...). - -local ctype - -if ctype=${${(f)"$(locale 2>/dev/null)"}:#^LC_CTYPE=*}; then - unset -m LC_\* - [[ -n $ctype ]] && eval export $ctype -else - ctype=${LC_ALL:-${LC_CTYPE:-${LANG:-C}}} - unset -m LC_\* - export LC_CTYPE=$ctype -fi -export LANG=C diff --git a/zsh_arm64/system/usr/share/zsh/functions/_compadd b/zsh_arm64/system/usr/share/zsh/functions/_compadd deleted file mode 100644 index e709e40..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_compadd +++ /dev/null @@ -1,52 +0,0 @@ -#compdef compadd - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -_arguments -C -s -S -A "-*" \ - '-P+[specify prefix]:prefix' \ - '-S+[specify suffix]:suffix' \ - '-p+[specify hidden prefix]:hidden prefix' \ - '-s+[specify hidden suffix]:hidden suffix' \ - '-i+[specify ignored prefix]:ignored prefix' \ - '-I+[specify ignored suffix]:ignored suffix' \ - '(-k)-a[matches are elements of specified arrays]' \ - '(-a)-k[matches are keys of specified associative arrays]' \ - '-d+[specify display strings]:array:_parameters -g "*array*"' \ - '-l[list display strings one per line, not in columns]' \ - '-o[order matches by match string not by display string]' \ - '(-1 -E)-J+[specify match group which will be sorted]:group' \ - '-V+[specify pre-ordered match group]:group' \ - '(-J -E)-1[remove only consecutive duplicates from group]' \ - '-2[preserve all duplicates]' \ - '(-x)-X[specify explanation]:explanation' \ - '(-X)-x[specify unconditional explanation]:explanation' \ - '-q[make suffix autoremovable]' \ - '-r+[specify character class for suffix autoremoval]:character class' \ - '-R+[specify function for suffix autoremoval]:function:_functions' \ - '-f[mark matches as being files]' \ - '-e[mark matches as being parameters]' \ - '-W[specify location for matches marked as files]' \ - '-F+[specify array of ignore patterns]:array:_parameters -g "*array*"' \ - '-Q[disable quoting of possible completions]' \ - '*-M[specify matching specifications]' \ - '-n[hide matches in completion listing]' \ - '-U[disable internal matching of completion candidates]' \ - '-O+[populate array with matches instead of adding them]:array:_parameters -g "*array*"' \ - '-A+[populate array with expanded matches instead of adding them]:array:_parameters -g "*array*"' \ - '-D+[delete elements from array corresponding to non-matching candidates]:array:_parameters -g "*array*"' \ - '-C[add special match that expands to all other matches]' \ - '(-1 -J)-E+[add specified number of display only matches]:number' \ - '*:candidate:->candidates' && ret=0 - -if [[ -n $state ]]; then - if (( $+opt_args[-a] )); then - _parameters -g "*array*" && ret=0 - elif (( $+opt_args[-k] )); then - _parameters -g "*assoc*" && ret=0 - else - _message -e candidate candidates - fi -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_compdef b/zsh_arm64/system/usr/share/zsh/functions/_compdef deleted file mode 100644 index 22af7f5..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_compdef +++ /dev/null @@ -1,79 +0,0 @@ -#compdef compdef - -local state line expl disp curcontext="$curcontext" pat normal ret=1 -local args1 args2 -typeset -A opt_args - -args2=() -if (( ! ${words[2,-1][(I)[^-]*]} || ${words[(I)-[kK]]} )); then - args1=( - -A '-*' - '(-d)-a[make function autoloadable]' - '(-d)-n[leave existing definitions intact]' - ) - args2=( - - d - '-d[delete]:*:completed command:->ccom' - - k - '-k[define widget and key binding]:completion function:->cfun:style:->style:*:key' - - K - '-K[define multiple widgets based on function]:*::: :->multi' - ) -else - args1=( - '!-a' '!-n' - '*-N[completion for named command]' - ) -fi - -_arguments -C -s -S \ - "$args1[@]" \ - '*-p[completion for command matching pattern]' \ - '*-P[completion for command matching pattern]' \ - ':completion function:->cfun' \ - '*:commands:->com' \ - "$args2[@]" && ret=0 - -if [[ $state = multi ]]; then - case $(( CURRENT % 3 )) in - 0) _message -e keys key - return 1;; - 1) state=cfun;; - 2) state=style;; - esac -fi - -case $state in - com) - pat="${words[(I)-[pP]]}" - normal="${words[(I)-N]}" - if (( pat && pat > normal )); then - _message -e patterns 'pattern' - else - _command_names && ret=0 - fi - ;; - ccom) - _wanted commands expl 'completed command' compadd -k _comps && ret=0 - ;; - cfun) - typeset -aU list=( ${(v)_comps} ${(k)functions[(I)_*]} ) - (( ${+list[1]} )) || list+=( ${^fpath:/.}/_(|*[^~])(:t) ) - if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then - disp=( ${list[@]#_} ) - _wanted functions expl 'completion function' \ - compadd -d disp -a list && ret=0 - else - _wanted functions expl 'completion function' compadd -a list && ret=0 - fi - ;; - style) - _wanted widgetstyle expl 'widget style' \ - compadd -M 'r:|-=* r:|=*' \ - complete-word delete-char-or-list expand-or-complete \ - expand-or-complete-prefix list-choices menu-complete \ - menu-expand-or-complete reverse-menu-complete && ret=0 - ;; -esac - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_complete b/zsh_arm64/system/usr/share/zsh/functions/_complete deleted file mode 100644 index 743fd04..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_complete +++ /dev/null @@ -1,144 +0,0 @@ -#autoload - -# Generate all possible completions. Note that this is not intended as -# a normal completion function, but as one possible value for the -# completer style. - -local comp name oldcontext ret=1 service -typeset -T curcontext="$curcontext" ccarray - -oldcontext="$curcontext" - -# If we have a user-supplied context name, use only that. - -if [[ -n "$compcontext" ]]; then - - if [[ "${(t)compcontext}" = *array* ]]; then - local expl - - _wanted values expl value compadd -a - compcontext - - elif [[ "${(t)compcontext}" = *assoc* ]]; then - local expl tmp i - - tmp=() - for i in "${(@k)compcontext[(R)*[^[:blank:]]]}"; do - tmp=( "$tmp[@]" "${i}:${compcontext[$i]}" ) - done - tmp=( "$tmp[@]" "${(k@)compcontext[(R)[[:blank:]]#]}" ) - - _describe -t values value tmp - - elif [[ "$compcontext" = *:*:* ]]; then - local tag="${${compcontext%%:*}:-values}" - local descr="${${${compcontext#${tag}:}%%:*}:-value}" - local action="${compcontext#${tag}:${descr}:}" expl ws ret=1 - - case "$action" in - \ #) - _message -e "$tag" "$descr";; - - \(\(*\)\)) - eval ws\=\( "${action[3,-3]}" \) - - _describe -t "$tag" "$descr" ws;; - - \(*\)) - eval ws\=\( "${action[2,-2]}" \) - - _wanted "$tag" expl "$descr" compadd -a - ws;; - - \{*\}) - _tags "$tag" - while _tags; do - while _next_label "$tag" expl "$descr"; do - eval "$action[2,-2]" && ret=0 - done - (( ret )) || break - done;; - - \ *) - eval ws\=\( "$action" \) - - _tags "$tag" - while _tags; do - while _next_label "$tag" expl "$descr"; do - "$ws[@]" - done - (( ret )) || break - done;; - - *) - eval ws\=\( "$action" \) - - _tags "$tag" - while _tags; do - while _next_label "$tag" expl "$descr"; do - "$ws[1]" "$expl[@]" "${(@)ws[2,-1]}" - done - (( ret )) || break - done;; - - esac - - else - ccarray[3]="$compcontext" - - comp="$_comps[$compcontext]" - [[ -n "$comp" ]] && eval "$comp" - fi - - return -fi - -# An entry for `-first-' is the replacement for `compctl -T' - -comp="$_comps[-first-]" -if [[ -n "$comp" ]]; then - service="${_services[-first-]:--first-}" - ccarray[3]=-first- - eval "$comp" && ret=0 - if [[ "$_compskip" = all ]]; then - _compskip= - return ret - fi -fi - -# If we are inside `vared' and we don't have a $compcontext, we treat -# this like a parameter assignment. Which it is. - -[[ -n $compstate[vared] ]] && compstate[context]=vared - -# For arguments and command names we use the `_normal' function. - -ret=1 -if [[ "$compstate[context]" = command ]]; then - curcontext="$oldcontext" - _normal -s && ret=0 -else - # Let's see if we have a special completion definition for the other - # possible contexts. - - local cname="-${compstate[context]:s/_/-/}-" - - ccarray[3]="$cname" - - comp="$_comps[$cname]" - service="${_services[$cname]:-$cname}" - - # If not, we use default completion, if any. - - if [[ -z "$comp" ]]; then - if [[ "$_compskip" = *default* ]]; then - _compskip= - return 1 - fi - comp="$_comps[-default-]" - service="${_services[-default-]:--default-}" - fi - [[ -n "$comp" ]] && eval "$comp" && ret=0 -fi - -_compskip= - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_complete_debug b/zsh_arm64/system/usr/share/zsh/functions/_complete_debug deleted file mode 100644 index 85a0f37..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_complete_debug +++ /dev/null @@ -1,36 +0,0 @@ -#compdef -k complete-word \C-x? - -eval "$_comp_setup" - -(( $+_debug_count )) || integer -g _debug_count -local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count] -local pager w="${(qq)words}" - -integer debug_fd=-1 -{ - if [[ -t 2 ]]; then - zmodload -F zsh/files b:zf_ln 2>/dev/null && - zf_ln -fn =(<<<'') $tmp && - exec {debug_fd}>&2 2>| $tmp - fi - - local -a debug_indent; debug_indent=( '%'{3..20}'(e. .)' ) - local PROMPT4 PS4="${(j::)debug_indent}+%N:%i> " - setopt xtrace - : $ZSH_NAME $ZSH_VERSION - ${1:-_main_complete} - integer ret=$? - unsetopt xtrace - - if (( debug_fd != -1 )); then - zstyle -s ':completion:complete-debug::::' pager pager - print -sR "${pager:-${PAGER:-${VISUAL:-${EDITOR:-more}}}} ${(q)tmp} ;: $w" - _message -r "Trace output left in $tmp (up-history to view)" - if [[ $compstate[nmatches] -le 1 && $compstate[list] != *force* ]]; then - compstate[list]='list force messages' - fi - fi -} always { - (( debug_fd != -1 )) && exec 2>&$debug_fd {debug_fd}>&- -} -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_complete_help b/zsh_arm64/system/usr/share/zsh/functions/_complete_help deleted file mode 100644 index 252b0e2..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_complete_help +++ /dev/null @@ -1,91 +0,0 @@ -#compdef -k complete-word \C-xh - -_complete_help() { - eval "$_comp_setup" - - local _sort_tags=_help_sort_tags text i j k tmp - typeset -A help_funcs help_tags help_sfuncs help_styles - - local -H _help_scan_funcstack="main_complete|complete|approximate|normal" - local -H _help_filter_funcstack="alternative|call_function|describe|dispatch|wanted|requested|all_labels|next_label" - - { - compadd() { return 1 } - compcall() { _help_sort_tags use-compctl } - zstyle() { - local _f="${${(@)${(@)funcstack[2,(i)_($~_help_scan_funcstack)]}:#(_($~_help_filter_funcstack)|\((eval|anon)\))}% *}" - - [[ -z "$_f" ]] && _f="${${(@)funcstack[2,(i)_($~_help_scan_funcstack)]}:#(_($~_help_filter_funcstack)|\((eval|anon)\))}" - - if [[ "$help_sfuncs[$2]" != *${_f}* || - "$help_styles[${2}${_f}]" != *${3}* ]]; then - - [[ "$help_sfuncs[$2]" != *${_f}* ]] && help_sfuncs[$2]+=$'\0'"${_f}" - local _t - - case "$1" in - -s) _t='[string] ';; - -a) _t='[array] ';; - -h) _t='[assoc] ';; - *) _t='[boolean]';; - esac - help_styles[${2}${_f}]+=",${_t} ${3}:${_f}" - fi - - # No need to call the completers more than once with different match specs. - - if [[ "$3" = matcher-list ]]; then - set -A "$4" '' - else - builtin zstyle "$@" - fi - } - - ${1:-_main_complete} - } always { - unfunction compadd compcall zstyle - } - - for i in "${(@ok)help_funcs}"; do - text+=$'\n'"tags in context :completion:${i}:" - tmp=() - for j in "${(@ps.\0.)help_funcs[$i][2,-1]}"; do - tmp+=( "${(@s.,.)help_tags[${i}${j}][2,-1]}" ) - done - zformat -a tmp ' (' "$tmp[@]" - tmp=( $'\n '${^tmp}')' ) - text+="${tmp}" - done - - if [[ ${NUMERIC:-1} -ne 1 ]]; then - text+=$'\n' - for i in "${(@ok)help_sfuncs}"; do - text+=$'\n'"styles in context ${i}" - tmp=() - for j in "${(@ps.\0.)help_sfuncs[$i][2,-1]}"; do - tmp+=( "${(@s.,.)help_styles[${i}${j}][2,-1]}" ) - done - zformat -a tmp ' (' "$tmp[@]" - tmp=( $'\n '${^tmp}')' ) - text+="${tmp}" - done - fi - compstate[list]='list force' - compstate[insert]='' - - compadd -UX "$text[2,-1]" -n '' -} - -_help_sort_tags() { - local f="${${(@)${(@)funcstack[3,(i)_($~_help_scan_funcstack)]}:#(_($~_help_filter_funcstack)|\((eval|anon)\))}% *}" - - if [[ "$help_funcs[$curcontext]" != *${f}* || - "$help_tags[${curcontext}${f}]" != *(${(j:|:)~argv})* ]]; then - [[ "$help_funcs[$curcontext]" != *${f}* ]] && - help_funcs[$curcontext]+=$'\0'"${f}" - help_tags[${curcontext}${f}]+=",${argv}:${f}" - comptry "$@" - fi -} - -_complete_help "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_complete_help_generic b/zsh_arm64/system/usr/share/zsh/functions/_complete_help_generic deleted file mode 100644 index 7aaa1a8..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_complete_help_generic +++ /dev/null @@ -1,17 +0,0 @@ -#autoload - -# Note this is a normal ZLE widget, not a completion widget. -# A completion widget can't call another widget, while a normal -# widget can. - -[[ $WIDGET = *noread* ]] || local ZSH_TRACE_GENERIC_WIDGET - -if [[ $WIDGET = *debug* ]]; then - ZSH_TRACE_GENERIC_WIDGET=_complete_debug -else - ZSH_TRACE_GENERIC_WIDGET=_complete_help -fi - -if [[ $WIDGET != *noread* ]]; then - zle read-command && zle $REPLY -w -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_complete_tag b/zsh_arm64/system/usr/share/zsh/functions/_complete_tag deleted file mode 100644 index 5b50f1d..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_complete_tag +++ /dev/null @@ -1,62 +0,0 @@ -#compdef -k complete-word \C-xt - -# Complete tags using either TAGS or tags. Looks up your directory -# hierarchy to find one. If both exist, uses TAGS. -# -# You can override the choice of tags file with $TAGSFILE (for TAGS) -# or $tagsfile (for tags). -# -# Could be rewritten by some sed expert to use sed instead of perl. - -emulate -L zsh - -# Tags file to look for -local c_Tagsfile=${TAGSFILE:-TAGS} c_tagsfile=${tagsfile:-tags} expl -# Max no. of directories to scan up through -integer c_maxdir=10 -# Context. -local curcontext="$curcontext" -local -a c_tags_array - -if [[ -z "$curcontext" ]]; then - curcontext="complete-tag:::" -else - curcontext="complete-tag:${curcontext#*:}" -fi - -local c_path= -integer c_idir -while [[ ! -f $c_path$c_Tagsfile && - ! -f $c_path$c_tagsfile && $c_idir -lt $c_maxdir ]]; do - (( c_idir++ )) - c_path=../$c_path -done - -if [[ -f $c_path$c_Tagsfile && $c_path$c_Tagsfile -ef $c_path$c_tagsfile && - "$(head -1 $c_path$c_tagsfile)" == '!_TAG_'* ]]; then - c_Tagsfile= -fi - -if [[ -f $c_path$c_Tagsfile ]]; then - # prefer the more comprehensive TAGS, which unfortunately is a - # little harder to parse. - # could do this with sed, just can't be bothered to work out how, - # after quarter of an hour of trying, except for - # rm -f =sed; ln -s /usr/local/bin/perl /usr/bin/sed - # but that's widely regarded as cheating. - c_tags_array=($(sed -n \ - -e 's/^\(.*[a-zA-Z_0-9]\)[[ '$'\t'':;,()]*'$'\177''.*$/\1/' \ - -e 's/^.*[^a-zA-Z_0-9]//' \ - -e '/^[a-zA-Z_].*/p' $c_path$c_Tagsfile)) -# c_tags_array=($(perl -ne '/([a-zA-Z_0-9]+)[ \t:;,\(]*\x7f/ && -# print "$1\n"' $c_path$c_Tagsfile)) - _main_complete - '' _wanted etags expl 'emacs tags' \ - compadd -a c_tags_array -elif [[ -f $c_path$c_tagsfile ]]; then - # tags doesn't have as much in, but the tag is easy to find. - # we can use awk here. - c_tags_array=($(awk '{ print $1 }' $c_path$c_tagsfile)) - _main_complete - '' _wanted vtags expl 'vi tags' compadd -a c_tags_array -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_completers b/zsh_arm64/system/usr/share/zsh/functions/_completers deleted file mode 100644 index 87c986a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_completers +++ /dev/null @@ -1,14 +0,0 @@ -#autoload - -# option: -p - needs a `_' prefix -local us -local -a disp list expl - -list=( complete approximate correct match expand list menu oldlist - ignored prefix history ) -zparseopts -D -K -E 'p=us' -[[ -n "$us" ]] && us='_' -zstyle -t ":completion:${curcontext}:completers" prefix-hidden && - disp=(-d list) -_wanted completers expl 'completer' \ - compadd "$@" "$disp[@]" - "$us${^list[@]}" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_condition b/zsh_arm64/system/usr/share/zsh/functions/_condition deleted file mode 100644 index 0285911..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_condition +++ /dev/null @@ -1,60 +0,0 @@ -#compdef -condition- - -local prev="$words[CURRENT-1]" ret=1 - -if [[ "$prev" = -o ]]; then - _tags -C -o options && _options -elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then - _tags -C "$prev" files && _files -elif [[ "$prev" = -t ]]; then - _file_descriptors -elif [[ "$prev" = -v ]]; then - _parameters -r "\= \t\n\[\-" -else - if [[ "$PREFIX" = -* ]] || - ! zstyle -T ":completion:${curcontext}:options" prefix-needed; then - - if [[ "$prev" = (\[\[|\|\||\&\&|\!|\() ]]; then - _describe -o 'condition code' \ - '( -a:existing\ file - -b:block\ special\ file - -c:character\ special\ file - -d:directory - -e:existing\ file - -f:regular\ file - -g:setgid\ bit - -h:symbolic\ link - -k:sticky\ bit - -n:non-empty\ string - -o:option - -p:named\ pipe - -r:readable\ file - -s:non-empty\ file - -t:terminal\ file\ descriptor - -u:setuid\ bit - -v:set\ variable - -w:writable\ file - -x:executable\ file - -z:empty\ string - -L:symbolic\ link - -O:own\ file - -G:group-owned\ file - -S:socket - -N:unread\ file)' && ret=0 - else - _describe -o 'condition code' \ - '( -nt:newer\ than - -ot:older\ than - -ef:same\ file - -eq:numerically\ equal - -ne:numerically\ not\ equal - -lt:numerically\ less\ than - -le:numerically\ less\ than\ or\ equal - -gt:numerically\ greater\ than - -ge:numerically\ greater\ than\ or\ equal)' && ret=0 - fi - fi - _alternative 'files:: _files' 'parameters:: _parameters' && ret=0 - - return ret -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_correct b/zsh_arm64/system/usr/share/zsh/functions/_correct deleted file mode 100644 index c9c3d99..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_correct +++ /dev/null @@ -1,19 +0,0 @@ -#autoload - -# This is mainly a wrapper around the more general `_approximate'. -# By setting `compstate[pattern_match]' to something unequal to `*' and -# then calling `_approximate', we get only corrections, not all strings -# with the corrected prefix and something after it. -# -# Supported configuration keys are the same as for `_approximate', only -# starting with `correct'. - -local ret=1 opm="$compstate[pattern_match]" - -compstate[pattern_match]='-' - -_approximate && ret=0 - -compstate[pattern_match]="$opm" - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_correct_filename b/zsh_arm64/system/usr/share/zsh/functions/_correct_filename deleted file mode 100644 index 3150ffc..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_correct_filename +++ /dev/null @@ -1,72 +0,0 @@ -#compdef -k complete-word \C-xC - -# Function to correct a filename. Can be used as a completion widget, -# or as a function in its own right, in which case it will print the -# corrected filename to standard output. -# -# You can adapt max_approx to the maximum number of mistakes -# which are allowed in total. -# -# If the numeric prefix is greater than 1, the maximum number of errors -# will be set to that. - -# Doesn't get right special characters in the filename; should -# strip them (e.g. "foo\ bar" -> "foo bar") and then re-insert them. - -emulate -LR zsh -setopt extendedglob - -local file="$PREFIX$SUFFIX" trylist tilde etilde testcmd -integer approx max_approx=6 - -if [[ -z $WIDGET ]]; then - file=$1 - local IPREFIX -else - (( ${NUMERIC:-1} > 1 )) && max_approx=$NUMERIC -fi - -if [[ $file = \~*/* ]]; then - tilde=${file%%/*} - etilde=${~tilde} 2>/dev/null - file=${file/#$tilde/$etilde} -fi - -if [[ $CURRENT -eq 1 && $file != /* ]]; then - testcmd=1 -elif [[ $file = \=* ]]; then - [[ -n $WIDGET ]] && PREFIX="$PREFIX[2,-1]" - IPREFIX="${IPREFIX}=" - file="$file[2,-1]" - testcmd=1 -fi - -# We need the -Q's to avoid the tilde we've put back getting quoted. -if [[ -z $testcmd && -e "$file" ]] || - { [[ -n $testcmd ]] && whence "$file" >&/dev/null }; then - if [[ -n $WIDGET ]]; then - compadd -QUf -i "$IPREFIX" -I "$ISUFFIX" "${file/#$etilde/$tilde}" - [[ -n "$compstate[insert]" ]] && compstate[insert]=menu - else - print "$file" - fi - return -fi - -for (( approx = 1; approx <= max_approx; approx++ )); do - if [[ -z $testcmd ]]; then - trylist=( (#a$approx)"$file"(N) ) - else - trylist=( "${(@)${(@f)$(whence -wm "(#a$approx)$file" 2>/dev/null)}%:*}" ) - [[ $file = */* ]] || trylist=(${trylist##*/}) - fi - (( $#trylist )) && break -done -(( $#trylist )) || return 1 - -if [[ -n $WIDGET ]]; then - compadd -QUf -i "$IPREFIX" -I "$ISUFFIX" "${trylist[@]/#$etilde/$tilde}" - [[ -n "$compstate[insert]" ]] && compstate[insert]=menu -else - print "$IPREFIX${^trylist[@]}" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_correct_word b/zsh_arm64/system/usr/share/zsh/functions/_correct_word deleted file mode 100644 index e81c7ac..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_correct_word +++ /dev/null @@ -1,15 +0,0 @@ -#compdef -k complete-word \C-xc - -# Simple completion front-end implementing spelling correction. -# The maximum number of errors is set quite high, and -# the numeric prefix can be used to specify a different value. - -local curcontext="$curcontext" - -if [[ -z "$curcontext" ]]; then - curcontext="correct-word:::" -else - curcontext="correct-word:${curcontext#*:}" -fi - -_main_complete _correct diff --git a/zsh_arm64/system/usr/share/zsh/functions/_default b/zsh_arm64/system/usr/share/zsh/functions/_default deleted file mode 100644 index 81744cd..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_default +++ /dev/null @@ -1,27 +0,0 @@ -#compdef -default- - -local ctl - -if { zstyle -s ":completion:${curcontext}:" use-compctl ctl || - zmodload -e zsh/compctl } && [[ "$ctl" != (no|false|0|off) ]]; then - local opt - - opt=() - [[ "$ctl" = *first* ]] && opt=(-T) - [[ "$ctl" = *default* ]] && opt=("$opt[@]" -D) - compcall "$opt[@]" || return 0 -fi - -_files "$@" && return 0 - -# magicequalsubst allows arguments like =~/foo to do -# file name expansion after the =. In that case, it's natural to -# allow completion to handle file names after any equals sign. - -if [[ -o magicequalsubst && "$PREFIX" = *\=* ]]; then - compstate[parameter]="${PREFIX%%\=*}" - compset -P 1 '*=' - _value "$@" -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_delimiters b/zsh_arm64/system/usr/share/zsh/functions/_delimiters deleted file mode 100644 index d98d5a7..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_delimiters +++ /dev/null @@ -1,16 +0,0 @@ -#autoload - -# Simple function to offer delimiters for modifiers and qualifiers. -# Single argument is tag to use. - -local expl -local -a list - -zstyle -a ":completion:${curcontext}:$1" delimiters list || - list=(: + / - %) - -if (( ${#list} )); then - _wanted delimiters expl delimiter compadd -S '' -a list -else - _message delimiter -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_describe b/zsh_arm64/system/usr/share/zsh/functions/_describe deleted file mode 100644 index 76ab1d9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_describe +++ /dev/null @@ -1,140 +0,0 @@ -#autoload - -# ### Note: Calling this function twice during one completion operation, such -# ### that in each call there exists a pair of items having the same description -# ### as each other, and the two calls specify the same $_type, currently leads -# ### to garbled output; see workers/35229 (May 2015) and its thread (which also -# ### discusses at least two other issues, that may or may not be related to -# ### this one). - -# This can be used to add options or values with descriptions as matches. - -local _opt _expl _tmpm _tmpd _mlen _noprefix -local _type=values _descr _ret=1 _showd _nm _hide _args _grp _sep -local csl="$compstate[list]" csl2 -local _oargv _argv _new _strs _mats _opts _i _try=0 -local OPTIND OPTARG -local -a _jvx12 - -# Get the option. - -while getopts "oOt:12JVx" _opt; do - case $_opt in - (o) - _type=options;; - (O) - _type=options - _noprefix=1 - ;; - (t) - _type="$OPTARG" - ;; - (1|2|J|V|x) - _jvx12+=(-$_opt) - esac -done -shift $(( OPTIND - 1 )) -unset _opt - -[[ "$_type$_noprefix" = options && ! -prefix [-+]* ]] && \ - zstyle -T ":completion:${curcontext}:options" prefix-needed && - return 1 - -# Do the tests. `showd' is set if the descriptions should be shown. - -zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes - -zstyle -s ":completion:${curcontext}:$_type" list-separator _sep || _sep=-- -zstyle -s ":completion:${curcontext}:$_type" max-matches-width _mlen || - _mlen=$((COLUMNS/2)) - -_descr="$1" -shift - -if [[ -n "$_showd" ]] && - zstyle -T ":completion:${curcontext}:$_type" list-grouped; then - _oargv=( "$@" ) - _grp=(-g) -else - _grp=() -fi - -[[ "$_type" = options ]] && - zstyle -t ":completion:${curcontext}:options" prefix-hidden && - _hide="${(M)PREFIX##(--|[-+])}" - -_tags "$_type" -while _tags; do - while _next_label $_jvx12 "$_type" _expl "$_descr"; do - - if (( $#_grp )); then - - set -- "$_oargv[@]" - _argv=( "$_oargv[@]" ) - _i=1 - (( _try++ )) - while (( $# )); do - - _strs="_a_$_try$_i" - if [[ "$1" = \(*\) ]]; then - eval local "_a_$_try$_i;_a_$_try$_i"'='$1 - else - eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )' - fi - _argv[_i]="_a_$_try$_i" - shift - (( _i++ )) - - if [[ "$1" = (|-*) ]]; then - _mats= - else - _mats="_a_$_try$_i" - if [[ "$1" = \(*\) ]]; then - eval local "_a_$_try$_i;_a_$_try$_i"'='$1 - else - eval local "_a_$_try$_i;_a_$_try$_i"'=( "${'$1'[@]}" )' - fi - _argv[_i]="_a_$_try$_i" - shift - (( _i++ )) - fi - - _opts=( "${(@)argv[1,(i)--]:#--}" ) - shift "$#_opts" - (( _i += $#_opts )) - if [[ $1 == -- ]]; then - shift - (( _i++ )) - fi - - if [[ -n $_mats ]]; then - compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs -O $_mats - \ - "${(@)${(@M)${(@P)_mats}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}" - else - compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ - "${(@)${(@M)${(@P)_strs}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}" - fi - done - set - "$_argv[@]" - fi - - if [[ -n "$_showd" ]]; then - compdescribe -I "$_hide" "$_mlen" "$_sep " _expl "$_grp[@]" "$@" - else - compdescribe -i "$_hide" "$_mlen" "$@" - fi - - compstate[list]="$csl" - - while compdescribe -g csl2 _args _tmpm _tmpd; do - - compstate[list]="$csl $csl2" - [[ -n "$csl2" ]] && compstate[list]="${compstate[list]:s/rows//}" - - compadd "$_args[@]" -d _tmpd -a _tmpm && _ret=0 - done - done - (( _ret )) || return 0 -done - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_description b/zsh_arm64/system/usr/share/zsh/functions/_description deleted file mode 100644 index 304c747..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_description +++ /dev/null @@ -1,111 +0,0 @@ -#autoload - -local name gropt nopt xopt format gname hidden hide match opts tag sort - -opts=() - -gropt=(-J) -xopt=(-X) -nopt=() -zparseopts -K -D -a nopt 1 2 V=gropt J=gropt x=xopt - -3="${${3##[[:blank:]]#}%%[[:blank:]]#}" -[[ -n "$3" ]] && _lastdescr=( "$_lastdescr[@]" "$3" ) - -zstyle -s ":completion:${curcontext}:$1" group-name gname && - [[ -z "$gname" ]] && gname="$1" - -_setup "$1" "${gname:--default-}" - -name="$2" - -zstyle -s ":completion:${curcontext}:$1" format format || - zstyle -s ":completion:${curcontext}:descriptions" format format - -if zstyle -s ":completion:${curcontext}:$1" hidden hidden && - [[ "$hidden" = (all|yes|true|1|on) ]]; then - [[ "$hidden" = all ]] && format='' - opts=(-n) -fi -zstyle -s ":completion:${curcontext}:$1" matcher match && - opts=($opts -M "$match") -[[ -n "$_matcher" ]] && opts=($opts -M "$_matcher") - -# Use sort style, but ignore `menu' value to help _expand. -# Also don't override explicit use of -V. -if { zstyle -s ":completion:${curcontext}:$1" sort sort || - zstyle -s ":completion:${curcontext}:" sort sort; } && - [[ "$gropt" = -J && $sort != menu ]]; then - if [[ "$sort" = (yes|true|1|on) ]]; then - gropt=(-J) - else - gropt=(-V) - fi -fi - -if [[ -z "$_comp_no_ignore" ]]; then - zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore || - _comp_ignore=() - - if zstyle -s ":completion:${curcontext}:$1" ignore-line hidden; then - local -a qwords - qwords=( ${words//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} ) - case "$hidden" in - true|yes|on|1) _comp_ignore+=( $qwords );; - current) _comp_ignore+=( $qwords[CURRENT] );; - current-shown) - [[ "$compstate[old_list]" = *shown* ]] && - _comp_ignore+=( $qwords[CURRENT] );; - other) _comp_ignore+=( $qwords[1,CURRENT-1] - $qwords[CURRENT+1,-1] );; - esac - fi - - # Ensure the ignore option is first so we can override it - # for fake-always. - (( $#_comp_ignore )) && opts=( -F _comp_ignore $opts ) -else - _comp_ignore=() -fi - -tag="$1" - -shift 2 -if [[ -z "$1" && $# -eq 1 ]]; then - format= -elif [[ -n "$format" ]]; then - zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}" -fi - -if [[ -n "$gname" ]]; then - if [[ -n "$format" ]]; then - set -A "$name" "$opts[@]" "$nopt[@]" "$gropt" "$gname" "$xopt" "$format" - else - set -A "$name" "$opts[@]" "$nopt[@]" "$gropt" "$gname" - fi -else - if [[ -n "$format" ]]; then - set -A "$name" "$opts[@]" "$nopt[@]" "$gropt" -default- "$xopt" "$format" - else - set -A "$name" "$opts[@]" "$nopt[@]" "$gropt" -default- - fi -fi - -if ! (( ${funcstack[2,-1][(I)_description]} )); then - local fakestyle descr - for fakestyle in fake fake-always; do - zstyle -a ":completion:${curcontext}:$tag" $fakestyle match || - continue - - descr=( "${(@M)match:#*[^\\]:*}" ) - - opts=("${(@P)name}") - if [[ $fakestyle = fake-always && $opts[1,2] = "-F _comp_ignore" ]]; then - shift 2 opts - fi - compadd "${(@)opts}" - "${(@)${(@)match:#*[^\\]:*}:s/\\:/:/}" - (( $#descr )) && _describe -t "$tag" '' descr "${(@)opts}" - done -fi - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_directory_stack b/zsh_arm64/system/usr/share/zsh/functions/_directory_stack deleted file mode 100644 index e84115a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_directory_stack +++ /dev/null @@ -1,45 +0,0 @@ -#compdef popd - -# This just completes the numbers after +, showing the full directory list -# with numbers. For - we do the same thing, but reverse the numbering (other -# way round if pushdminus is set). Note that this function is also called -# from _cd for cd and pushd. - -setopt localoptions nonomatch - -local expl list lines revlines disp sep - -### we decided against this, for now... -#! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed || - -[[ $PREFIX = [-+]* ]] || return 1 - -zstyle -s ":completion:${curcontext}:directory-stack" list-separator sep || sep=-- - -if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then - # get the list of directories with their canonical number - # and turn the lines into an array, removing the current directory - lines=("${(D)dirstack[@]}") - - if [[ ( $PREFIX[1] = - && ! -o pushdminus ) || - ( $PREFIX[1] = + && -o pushdminus ) ]]; then - integer i - revlines=( $lines ) - for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$((i-1)) $sep ${revlines[-$i]##[0-9]#[ ]#}" - done - else - for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$i $sep ${lines[$i]##[0-9]#[ ]#}" - done - fi - # get the array of numbers only - list=( ${PREFIX[1]}${^lines%% *} ) - disp=( -ld lines ) -else - list=( ${PREFIX[1]}{0..${#dirstack}} ) - disp=() -fi - -_wanted -V directory-stack expl 'directory stack' \ - compadd "$@" "$disp[@]" -Q -a list diff --git a/zsh_arm64/system/usr/share/zsh/functions/_dirs b/zsh_arm64/system/usr/share/zsh/functions/_dirs deleted file mode 100644 index 0281f37..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_dirs +++ /dev/null @@ -1,8 +0,0 @@ -#compdef dirs - -_arguments -s \ - '(-)-c[clear the directory stack]' \ - '(* -c)-l[display directory names in full]' \ - '(* -c)-v[display numbered list of directory stack]' \ - '(* -c)-p[display directory entries one per line]' \ - '(-)*:directory:_directories' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_disable b/zsh_arm64/system/usr/share/zsh/functions/_disable deleted file mode 100644 index 52b82a6..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_disable +++ /dev/null @@ -1,16 +0,0 @@ -#compdef disable - -local -a ali_arr sali_arr func_arr - -ali_arr=(${(k)aliases} ${(k)galiases}) -sali_arr=(${(k)saliases}) -func_arr=(${(k)functions}) - -_arguments -C -s -A "-*" -S \ - "(-f -r -s -p)-a[act on regular or global aliases]:*:regular or global aliases:compadd -k ali_arr" \ - "(-a -r -s -p)-f[act on functions]:*:functions:compadd -k func_arr" \ - "(-a -f -s -p)-r[act on reserved words]:*:reserved-words:compadd -k reswords" \ - "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:compadd -k sali_arr" \ - "(-a -f -r -s)-p[act on pattern characters]:*:pattern characters:compadd -k patchars" \ - '-m[treat arguments as patterns]' \ - "*:builtin command:(${(k)builtins})" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_dispatch b/zsh_arm64/system/usr/share/zsh/functions/_dispatch deleted file mode 100644 index 3f6fe5b..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_dispatch +++ /dev/null @@ -1,91 +0,0 @@ -#autoload - -local comp pat val name i ret=1 _compskip="$_compskip" -local curcontext="$curcontext" service str noskip -local -a match mbegin mend - -# If we get the option `-s', we don't reset `_compskip'. - -if [[ "$1" = -s ]]; then - noskip=yes - shift -fi - -[[ -z "$noskip" ]] && _compskip= - -curcontext="${curcontext%:*:*}:${1}:" - -shift - -# See if there are any matching pattern completions. - -if [[ "$_compskip" != (all|*patterns*) ]]; then - - for str in "$@"; do - [[ -n "$str" ]] || continue - service="${_services[$str]:-$str}" - for i in "${(@)_patcomps[(K)$str]}"; do - if [[ $i = (#b)"="([^=]#)"="(*) ]]; then - service=$match[1] - i=$match[2] - fi - eval "$i" && ret=0 - if [[ "$_compskip" = *patterns* ]]; then - break - elif [[ "$_compskip" = all ]]; then - _compskip='' - return ret - fi - done - done -fi - -# Now look up the names in the normal completion array. - -ret=1 -for str in "$@"; do - [[ -n "$str" ]] || continue - # The following means we look up the names of commands - # after stripping quotes. This is presumably correct, - # but do we need to do the same elsewhere? - str=${(Q)str} - name="$str" - comp="${_comps[$str]}" - service="${_services[$str]:-$str}" - - [[ -z "$comp" ]] || break -done - -# And generate the matches, probably using default completion. - -if [[ -n "$comp" && "$name" != "${argv[-1]}" ]]; then - _compskip=patterns - eval "$comp" && ret=0 - [[ "$_compskip" = (all|*patterns*) ]] && return ret -fi - -if [[ "$_compskip" != (all|*patterns*) ]]; then - for str; do - [[ -n "$str" ]] || continue - service="${_services[$str]:-$str}" - for i in "${(@)_postpatcomps[(K)$str]}"; do - _compskip=default - eval "$i" && ret=0 - if [[ "$_compskip" = *patterns* ]]; then - break - elif [[ "$_compskip" = all ]]; then - _compskip='' - return ret - fi - done - done -fi - -[[ "$name" = "${argv[-1]}" && -n "$comp" && - "$_compskip" != (all|*default*) ]] && - service="${_services[$name]:-$name}" && - eval "$comp" && ret=0 - -_compskip='' - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_dynamic_directory_name b/zsh_arm64/system/usr/share/zsh/functions/_dynamic_directory_name deleted file mode 100644 index f449c3b..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_dynamic_directory_name +++ /dev/null @@ -1,15 +0,0 @@ -#autoload - -local func -integer ret=1 - -if [[ -n $functions[zsh_directory_name] || \ - ${+zsh_directory_name_functions} -ne 0 ]] ; then - [[ -n $functions[zsh_directory_name] ]] && zsh_directory_name c && ret=0 - for func in $zsh_directory_name_functions; do - $func c && ret=0 - done - return ret -else - _message 'dynamic directory name: implemented as zsh_directory_name c' -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_echotc b/zsh_arm64/system/usr/share/zsh/functions/_echotc deleted file mode 100644 index 79eb6d9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_echotc +++ /dev/null @@ -1,5 +0,0 @@ -#compdef echotc - -local expl - -_wanted arguments expl 'terminal capability' compadd -k termcap diff --git a/zsh_arm64/system/usr/share/zsh/functions/_echoti b/zsh_arm64/system/usr/share/zsh/functions/_echoti deleted file mode 100644 index ed3a98f..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_echoti +++ /dev/null @@ -1,5 +0,0 @@ -#compdef echoti - -local expl - -_wanted arguments expl 'terminal capability' compadd -k terminfo diff --git a/zsh_arm64/system/usr/share/zsh/functions/_emulate b/zsh_arm64/system/usr/share/zsh/functions/_emulate deleted file mode 100644 index d6fb0c3..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_emulate +++ /dev/null @@ -1,8 +0,0 @@ -#compdef emulate - -_arguments -C -s \ - '-L[set local_options and local_traps as well]' \ - '-R[reset all options instead of only those needed for script portability]' \ - '1:shell to emulate:(zsh sh ksh csh)' \ - '2:specify optional command:(-c)' \ - '3:command:_cmdstring' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_enable b/zsh_arm64/system/usr/share/zsh/functions/_enable deleted file mode 100644 index 9410651..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_enable +++ /dev/null @@ -1,16 +0,0 @@ -#compdef enable - -local -a ali_arr sali_arr func_arr - -ali_arr=(${(k)dis_aliases} ${(k)dis_galiases}) -sali_arr=(${(k)dis_saliases}) -func_arr=(${(k)dis_functions}) - -_arguments -C -s -A "-*" -S \ - "(-f -r -s -p)-a[act on regular or global aliases]:*:aliases:compadd -k ali_arr" \ - "(-a -r -s -p)-f[act on functions]:*:functions:compadd -k func_arr" \ - "(-a -f -s -p)-r[act on reserved words]:*:reserved-words:compadd -k dis_reswords" \ - "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:compadd -k sali_arr" \ - "(-a -f -r -s)-p[act on pattern characters]:*:pattern characters:compadd -k dis_patchars" \ - '-m[treat arguments as patterns]' \ - "*:builtin command:(${(k)dis_builtins})" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_equal b/zsh_arm64/system/usr/share/zsh/functions/_equal deleted file mode 100644 index 58a415d..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_equal +++ /dev/null @@ -1,3 +0,0 @@ -#compdef -equal- - -_path_commands diff --git a/zsh_arm64/system/usr/share/zsh/functions/_exec b/zsh_arm64/system/usr/share/zsh/functions/_exec deleted file mode 100644 index 8de341a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_exec +++ /dev/null @@ -1,9 +0,0 @@ -#compdef exec - -[[ $service == exec ]] && precommands+=( exec ) - -_arguments -s -S -A '-*' : \ - '-a+[set argv\[0\] to specified string]:argv[0] string' \ - '-c[clear environment]' \ - '-l[simulate login shell (prepend - to argv\[0\])]' \ - '*:: : _normal' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_expand b/zsh_arm64/system/usr/share/zsh/functions/_expand deleted file mode 100644 index f490982..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_expand +++ /dev/null @@ -1,244 +0,0 @@ -#autoload - -# This completer function is intended to be used as the first completer -# function and allows one to say more explicitly when and how the word -# from the line should be expanded than expand-or-complete. -# This function will allow other completer functions to be called if -# the expansions done produce no result or do not change the original -# word from the line. - -setopt localoptions nonomatch - -[[ _matcher_num -gt 1 ]] && return 1 - -local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre -local continue=0 - -(( $# )) && - while getopts gsco opt; do - force="$force$opt" - done - -if [[ "$funcstack[2]" = _prefix ]]; then - word="$IPREFIX$PREFIX$SUFFIX" -else - word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" -fi - -[[ "$word" = *\$(|\{[^\}]#) || - ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] && - return 1 - -### I'm not sure about the pattern to use in the following test. -# It once was: -# [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] && - -zstyle -T ":completion:${curcontext}:" suffix && - [[ "$word" = (\~*/*|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) && - "${(e)word}" != (#s)(*[^\\]|)[][^*?\(\)\<\>\{\}\|]* ]] && - return 1 - -zstyle -s ":completion:${curcontext}:" accept-exact tmp || - [[ ! -o recexact ]] || tmp=1 - -if [[ "$tmp" != (yes|true|on|1) ]]; then - { [[ "$word" = \~(|[-+]) || - ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) || - $word = \~\[*\]/* ]] && return 1 } - { [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -gt 1 ) || - ( "$word" = *\$[a-zA-Z0-9_]## && - ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 } - [[ continue -eq 1 && "$tmp" != continue ]] && return 1 -fi - -# In exp we will collect the expansions. - -exp=("$word") - -# First try substitution. That weird thing spanning multiple lines -# changes quoted spaces, tabs, and newlines into spaces and protects -# this function from aborting on parse errors in the expansion. - -if [[ "$force" = *s* ]] || - zstyle -T ":completion:${curcontext}:" substitute; then - -### We once used this: -### -### [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]] && -### eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \) 2>/dev/null -### -### instead of the following loop to expand braces. But that made -### parameter expressions such as ${foo} be expanded like brace -### expansions, too (and with braceccl set...). - - if [[ ! $_comp_caller_options[ignorebraces] == on && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]]; then - local otmp - - tmp=${(q)word} - while [[ $#tmp != $#otmp ]]; do - otmp=$tmp - tmp=${tmp//(#b)\\\$\\\{(([^\{\}]|\\\\{|\\\\})#)([^\\])\\\}/\\$\\\\{${match[1]}${match[3]}\\\\}} - done - eval exp\=\( ${tmp:gs/\\{/\{/:gs/\\}/\}/} \) 2>/dev/null - fi - -### There's a bug: spaces resulting from brace expansion are quoted in -### the following expression, too. We don't want that, but I have no -### idea how to fix it. - - setopt aliases - eval 'exp=( ${${(e)exp//\\[ -]/ }//(#b)([ -])/\\$match[1]} )' 2>/dev/null - setopt NO_aliases -else - exp=( ${exp:s/\\\$/\$} ) -fi - -# If the array is empty, store the original string again. - -[[ -z "$exp" ]] && exp=("$word") - -subd=("$exp[@]") - -# Now try globbing. - -# We need to come out of this with consistent quoting, by hook or by crook. -integer done_quote -local orig_exp=$exp -if [[ "$force" = *g* ]] || zstyle -T ":completion:${curcontext}:" glob; then - eval 'exp=( ${~exp//(#b)\\([ \"'"\'"' -])/$match[1]} ); exp=( ${(q)exp} )' 2>/dev/null && done_quote=1 -fi -# If the globbing failed, or we didn't try globbing, we'll do -# it again without the "~" so globbing is simply omitted. -if (( ! done_quote )); then - eval 'exp=( ${orig_exp//(#b)\\([ \"'"\'"' -])/$match[1]} ); exp=( ${(q)exp} )' 2>/dev/null -fi - -### Don't remember why we once used this instead of the (q) above. -# eval 'exp=( ${~exp} ); exp=( ${exp//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} )' 2>/dev/null - -# If we don't have any expansions or only one and that is the same -# as the original string, we let other completers run. - -(( $#exp )) || exp=("$subd[@]") - -[[ $#exp -eq 1 && "${exp[1]//\\}" = "${word//\\}"(|\(N\)) ]] && return 1 - -# With subst-globs-only we bail out if there were no glob expansions, -# regardless of any substitutions - -{ [[ "$force" = *o* ]] || - zstyle -t ":completion:${curcontext}:" subst-globs-only } && - [[ "$subd" = "$exp"(|\(N\)) ]] && return 1 - -zstyle -s ":completion:${curcontext}:" keep-prefix tmp || tmp=changed - -if [[ "$word" = (\~*/*|*\$*/*) && "$tmp" = (yes|true|on|1|changed) ]]; then - if [[ "$word" = *\$* ]]; then - opre="${(M)word##*\$[^/]##/}" - else - opre="${word%%/*}" - fi - eval 'epre=( ${(e)~opre} )' 2> /dev/null - - if [[ -n "$epre" && $#epre -eq 1 ]]; then - pre="${(q)epre[1]}" - [[ ( "$tmp" != changed || $#exp -gt 1 || - "${opre}${exp[1]#${pre}}" != "$word" ) && "${exp[1]}" = $pre* ]] && - exp=( ${opre}${^exp#${pre}} ) - fi - [[ $#exp -eq 1 && "$exp[1]" = "$word" ]] && return 1 -fi - -# Now add as matches whatever the user requested. - -zstyle -s ":completion:${curcontext}:" sort sort - -[[ "$sort" = (yes|true|1|on) ]] && exp=( "${(@o)exp}" ) - -if zstyle -s ":completion:${curcontext}:" add-space tmp; then - if [[ "$tmp" != *subst* || "$word" != *\$* || "$exp[1]" = *\$* ]]; then - [[ "$tmp" = *file* ]] && asp=file - [[ "$tmp" = *(yes|true|1|on|subst)* ]] && asp="yes$asp" - fi -else - asp=file -fi - -# If there is only one expansion, add a suitable suffix - -if (( $#exp == 1 )); then - if [[ -d ${exp[1]/${opre}/${pre}} && "$exp[1]" != */ ]]; then - suf=/ - elif [[ "$asp" = yes* || - ( "$asp" = *file && -f "${exp[1]/${opre}/${pre}}" ) ]]; then - suf=' ' - else - suf= - fi -fi - -if [[ -z "$compstate[insert]" ]] ;then - if [[ "$sort" = menu ]]; then - _description expansions expl expansions "o:$word" - else - _description -V expansions expl expansions "o:$word" - fi - - compadd "$expl[@]" -UQ -qS "$suf" -a exp -else - _tags all-expansions expansions original - - if [[ $#exp -ge 1 ]] && _requested expansions; then - local i j normal space dir - - if [[ "$sort" = menu ]]; then - _description expansions expl expansions "o:$word" - else - _description -V expansions expl expansions "o:$word" - fi - normal=() - space=() - dir=() - - for i in "$exp[@]"; do - j="${i/${opre}/${pre}}" - if [[ -d "$j" && "$i" != */ ]]; then - dir=( "$dir[@]" "$i" ) - elif [[ "$asp" = yes* || ( "$asp" = *file && -f "$j" ) ]]; then - space=( "$space[@]" "$i" ) - else - normal=( "$normal[@]" "$i" ) - fi - done - (( $#dir )) && compadd "$expl[@]" -UQ -qS/ -a dir - (( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space - (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal - fi - if _requested all-expansions; then - local disp dstr - - if [[ "$sort" = menu ]]; then - _description all-expansions expl 'all expansions' "o:$word" - else - _description -V all-expansions expl 'all expansions' "o:$word" - fi - if [[ "${#${exp}}" -ge COLUMNS ]]; then - disp=( -ld dstr ) - dstr=( "${(r:COLUMNS-5:)exp} ..." ) - else - disp=() - fi - [[ -o multios ]] && exp=($exp[1] $compstate[redirect]${^exp[2,-1]}) - compadd "$disp[@]" "$expl[@]" -UQ -qS "$suf" - "$exp" - fi - - _requested original expl original && compadd "$expl[@]" -UQ - "$word" - - compstate[insert]=menu -fi - -return continue diff --git a/zsh_arm64/system/usr/share/zsh/functions/_expand_alias b/zsh_arm64/system/usr/share/zsh/functions/_expand_alias deleted file mode 100644 index 8240e41..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_expand_alias +++ /dev/null @@ -1,67 +0,0 @@ -#compdef -K _expand_alias complete-word \C-xa - -local word expl tmp pre sel what -local -a tmpa suf - -eval "$_comp_setup" - -if [[ -n $funcstack[2] ]]; then - if [[ "$funcstack[2]" = _prefix ]]; then - word="$IPREFIX$PREFIX$SUFFIX" - else - word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" - fi - pre=() -else - local curcontext="$curcontext" - - if [[ -z "$curcontext" ]]; then - curcontext="expand-alias-word:::" - else - curcontext="expand-alias-word:${curcontext#*:}" - fi - - word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" - pre=(_main_complete - aliases) -fi - -zstyle -s ":completion:${curcontext}:" regular tmp || tmp=yes -case $tmp in -always) sel=r;; -yes|1|true|on) [[ CURRENT -eq 1 ]] && sel=r;; -esac -zstyle -T ":completion:${curcontext}:" global && sel="g$sel" -zstyle -t ":completion:${curcontext}:" disabled && sel="${sel}${(U)sel}" - -tmp= -[[ $sel = *r* ]] && tmp=$aliases[$word] -[[ -z $tmp && $sel = *g* ]] && tmp=$galiases[$word] -[[ -z $tmp && $sel = *R* ]] && tmp=$dis_aliases[$word] -[[ -z $tmp && $sel = *G* ]] && tmp=$dis_galiases[$word] - -if [[ -n $tmp ]]; then - # We used to remove the quoting from the value in the parameter. - # That was probably just an oversight: an alias is always replaced - # literally. - tmp=${tmp%%[[:blank:]]##} - if [[ $tmp[1] = [[:alnum:]_] ]]; then - tmpa=(${(z)tmp}) - if [[ $tmpa[1] = $word && $tmp = $aliases[$word] ]]; then - # This is an active regular alias and the first word in the result - # is the same as what was on the line already. Quote it so - # that it doesn't get reexanded on execution. - # - # Strictly we also need to check if the original word matches - # a later word in the expansion and the previous words are - # all aliases where the expansion ends in " ", but I'm - # too lazy. - tmp="\\$tmp" - fi - fi - zstyle -T ":completion:${curcontext}:" add-space || suf=( -S '' ) - $pre _wanted aliases expl alias compadd -UQ "$suf[@]" -- ${tmp%%[[:blank:]]##} -elif (( $#pre )) && zstyle -t ":completion:${curcontext}:" complete; then - $pre _aliases -s "$sel" -S '' -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_expand_word b/zsh_arm64/system/usr/share/zsh/functions/_expand_word deleted file mode 100644 index 9b71dc8..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_expand_word +++ /dev/null @@ -1,13 +0,0 @@ -#compdef -K _expand_word complete-word \C-xe _list_expansions list-choices \C-xd - -# Simple completion front-end implementing expansion. - -local curcontext="$curcontext" - -if [[ -z "$curcontext" ]]; then - curcontext="expand-word:::" -else - curcontext="expand-word:${curcontext#*:}" -fi - -_main_complete _expand diff --git a/zsh_arm64/system/usr/share/zsh/functions/_extensions b/zsh_arm64/system/usr/share/zsh/functions/_extensions deleted file mode 100644 index 8b6c4fd..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_extensions +++ /dev/null @@ -1,33 +0,0 @@ -#autoload - -# This completer completes filename extensions when completing -# after *. or ^*. It can be used anywhere in the completer list -# but if used after _expand, patterns that already match a file -# will be expanded before it is called. - -compset -P '(#b)([~$][^/]#/|)(*/|)(\^|)\*.' || return 1 - -local -aU files -local -a expl suf mfiles - -files=( ${(e)~match[1]}${match[2]}*.* ) || return 1 -eval set -A files '${(MSI:'{1..${#${(O)files//[^.]/}[1]}}':)files%%.[^/]##}' -files=( ${files:#.<->(.*|)} ) - -if zstyle -t ":completion:${curcontext}:extensions" prefix-hidden; then - files=( ${files#.} ) -else - PREFIX=".$PREFIX" - IPREFIX="${IPREFIX%.}" -fi - -zstyle -T ":completion:${curcontext}:extensions" add-space || - suf=( -S '' ) - -_description extensions expl 'file extension' - -# for an exact match, fail so as to give _expand or _match a chance. -compadd -O mfiles "$expl[@]" -a files -[[ $#mfiles -gt 1 || ${mfiles[1]} != $PREFIX ]] && - compadd "$expl[@]" "$suf[@]" -a files && - [[ -z $compstate[exact_string] ]] diff --git a/zsh_arm64/system/usr/share/zsh/functions/_external_pwds b/zsh_arm64/system/usr/share/zsh/functions/_external_pwds deleted file mode 100644 index dfc1abe..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_external_pwds +++ /dev/null @@ -1,43 +0,0 @@ -#autoload - -# Completes current directories of other zsh processes -# this is intended to be used via _generic bound to a -# different key. Note that pattern matching is enabled. - -local -a expl -local -au dirs - -# undo work _main_complete did to remove the tilde -PREFIX="$IPREFIX$PREFIX" -IPREFIX= -SUFFIX="$SUFFIX$ISUFFIX" -ISUFFIX= - -[[ -o magicequalsubst ]] && compset -P '*=' - -case $OSTYPE in - solaris*) - dirs=( - ${(M)${${(f)"$(pgrep -U $UID -x zsh|xargs pwdx 2>/dev/null)"}:#$$:*}%%/*} - ) - ;; - linux*) - dirs=( /proc/${^$(pidof -- -zsh zsh):#$$}/cwd(N:P) ) - dirs=( $^dirs(N^@) ) - ;; - freebsd*) - dirs=( $(pgrep -U $UID -x zsh) ) - dirs=( $(procstat -h -f $dirs|awk '{if ($3 == "cwd") print $NF}') ) - ;; - *) - if (( $+commands[lsof] )); then - dirs=( ${${${(M)${(f)"$(lsof -a -u $EUID -c zsh -p \^$$ -d cwd -F n -w - 2>/dev/null)"}:#n*}#?}%% \(*} ) - fi - ;; -esac -dirs=( ${(D)dirs:#$PWD} ) - -compstate[pattern_match]='*' -_wanted directories expl 'current directory from other shell' \ - compadd -M "r:|/=* r:|=*" -f -a dirs diff --git a/zsh_arm64/system/usr/share/zsh/functions/_fc b/zsh_arm64/system/usr/share/zsh/functions/_fc deleted file mode 100644 index dd014e7..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_fc +++ /dev/null @@ -1,91 +0,0 @@ -#compdef fc history r - -local curcontext="$curcontext" state state_descr line expl ret=1 -local num cmd sep -local -a events -typeset -A opt_args -local fc_common fc_hist fc_r - -# hide any replacements from _arguments -local cur=${(M)#words[1,CURRENT-1]:#*=*} -words=( "${(@)words[1,CURRENT-1]:#*=*}" "${(@)words[CURRENT,-1]}" ) -(( CURRENT -= cur )) - -fc_common=( - -s -S - '(-A -R -W -p -P)-I[include internal (new) events only]' - '(-A -R -W -p -P)-L[include local events only]' - '(-A -R -W -p -P)-r[reverse order of the events]' - '(-A -R -W -e -p -P)-n[suppress line numbers]' -) - -if [[ -n ${words[(r)-[pa](|[ap])]} ]]; then - fc_common+=( - ':history file:_files' - ':history size:' - ':saved history size:' - ) - [[ -n ${words[(r)-(|a)p(|a)]} ]] || fc_common+='!-a:option:(-p)' -elif [[ -n ${words[(r)-*[ARWI]*]} ]]; then - fc_common+=( ':history file:_files' ) -else - fc_common=( -C "$fc_common[@]" - '(-)1:first event:->events' '2:last event:->events' - ) -fi - -fc_hist=( - '(-A -R -W -a -p -P 2)-m[treat argument as a pattern]' - '(-A -R -W -e -f -E -i -t -a -p -P)-d[print time-stamps]' - '(-A -R -W -e -d -E -i -t -a -p -P)-f[mm/dd/yyyy format time-stamps]' - '(-A -R -W -e -d -f -i -t -a -p -P)-E[dd.mm.yyyy format time-stamps]' - '(-A -R -W -e -d -f -E -t -a -p -P)-i[yyyy-mm-dd format time-stamps]' - '(-A -R -W -e -d -f -E -i -a -p -P)-t[print time-stamps in specified format]:date format' - '(-A -R -W -e -a -p -P)-D[print elapsed times]' - - '(-A -R -W -I -e -d -f -i -l -m -n -r -D -E -t -P)-a[with -p, automatically pop history on function return]' - '(-A -R -W -I -e -d -f -i -l -m -n -r -D -E -t -P)-p[push current history to stack]' - '(- *)-P[pop history from stack]' -) - -fc_r='(-A -R -W -e)-l[list resulting commands on stdout]' - -case $service in - history) - _arguments "$fc_common[@]" "$fc_hist[@]" && ret=0 - ;; - r) - _arguments "$fc_common[@]" "$fc_r" && ret=0 - ;; - *) - _arguments "$fc_common[@]" "$fc_hist[@]" "$fc_r" \ - '(-A -R -W -a -l -n -d -f -E -i -r -t -D -p -P)-e+[specify editor to invoke]:editor to invoke:_command_names -e' \ - '(-a -l -L -m -e -r -n -d -f -t -E -i -R -D -A -W -p -P *)-'{\ -'R[read history from file]',\ -'A[append history to file]',\ -'W[write history to file]'} && ret=0 - ;; -esac - -if [[ -n $state ]]; then - zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- - if [[ -z ${line:#*=*} ]] && compset -P 1 '*='; then - _message -e replacements 'replacement' - elif [[ -prefix [0-9] ]]; then - print -v events -f "%-${#HISTNO}.${#HISTNO}s $sep %s" "${(kv)history[@]}" - _wanted -2V events expl "$state_descr" compadd -M "B:0=" -ld events - \ - "${events[@]%% *}" - elif [[ -prefix - ]]; then - for num cmd in "${(kv@)history}"; do - (( num=num - HISTNO )) - events+=( "${(r.1+$#HISTNO.)num} $sep $cmd" ) - done - _wanted -2V events expl "$state_descr" compadd -ld events - \ - "${events[@]%% *}" - else - _wanted events expl "$state_descr" compadd -S '' - \ - ${${history%%[=[:IFS:]]*}:#[0-9-]*} || _guard "[0-9]#" event - fi -fi && ret=0 - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_file_descriptors b/zsh_arm64/system/usr/share/zsh/functions/_file_descriptors deleted file mode 100644 index 3e9f496..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_file_descriptors +++ /dev/null @@ -1,59 +0,0 @@ -#autoload - -local i fds expl disp link sep -local -a list proc - -fds=( /dev/fd/<3->(N:t) ) -fds=( ${(n)fds} ) - -if zstyle -T ":completion:${curcontext}:file-descriptors" verbose; then - zstyle -s ":completion:${curcontext}:file-descriptors" list-separator sep || sep=-- - - if [[ $OSTYPE = freebsd* ]]; then - fds=( ${(f)"$(procstat -f $$|awk -v OFS=: '$3>2 && $3~/[0-9]/ {print $3,$10}')"} ) - zformat -a list " $sep " $fds - fds=( ${fds%%:*} ) - elif - proc=( /proc/$$/(fd|path)/<->(@N[-1]:h) ) - [[ -n $proc ]] - then - if zmodload -F zsh/stat b:zstat; then - for i in "${fds[@]}"; do - if zstat +link -A link $proc/$i; then - list+=( "${(r.$#fds[-1].)i} $sep ${(D)link[1]}" ) - else - fds[(i)$i]=() - fi - done - elif (( $+commands[readlink] )); then - for i in "${fds[@]}"; do - if link=$(readlink $proc/$i); then - list+=( "${(r.$#fds[-1].)i} $sep ${(D)link}" ) - else - fds[(i)$i]=() - fi - done - else - for i in "${fds[@]}"; do - if link=$(ls -l $proc/$i); then - list+=( "${(r.$#fds[-1].)i} $sep ${(D)link#* -> }" ) - else - fds[(i)$i]=() - fi - done - fi 2>/dev/null - fi - - if (( list[(I)* $sep ?*] )); then - list=( - "${(r.$#fds[-1].):-0} $sep standard input" - "${(r.$#fds[-1].):-1} $sep standard output" - "${(r.$#fds[-1].):-2} $sep standard error" $list - ) - disp=( -d list ) - fi -fi -fds=( 0 1 2 $fds ) - -_description -V file-descriptors expl 'file descriptor' -compadd $disp "${@/-J/-V}" "$expl[@]" -a fds diff --git a/zsh_arm64/system/usr/share/zsh/functions/_first b/zsh_arm64/system/usr/share/zsh/functions/_first deleted file mode 100644 index 4b565fc..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_first +++ /dev/null @@ -1,47 +0,0 @@ -#compdef -first- - -# This function is called at the very beginning before any other -# function for a specific context. -# -# This just gives some examples of things you might want to do here. -# -# -# Other things you can do here is to complete different things if the -# word on the line matches a certain pattern. This example allows -# completion of words from the history by adding two commas at the end -# and hitting TAB. -# -# if [[ "$PREFIX" = *,, ]]; then -# local max i=1 expl opt -# -# PREFIX="$PREFIX[1,-2]" -# # If a numeric prefix is given, we use it as the number of -# # lines (multiplied by ten below) in the history to search. -# if [[ ${NUMERIC:-1} -gt 1 ]]; then -# max=$NUMERIC -# unset NUMERIC -# else -# # The default is to search the last 100 lines. -# max=10 -# fi -# # We first search in the last ten words, then in the last -# # twenty words, and so on... -# while [[ i -le max ]]; do -# if zstyle -t ":completion:${curcontext}:history-words" sort; then -# opt=-J -# else -# opt=-V -# fi -# if _wanted "$opt" history-words expl "history ($n)" \ -# compadd -Q - \ -# "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then -# # We have found at least one matching word, so we switch -# # on menu-completion and make sure that no other -# # completion function is called by setting _compskip. -# compstate[insert]=menu -# _compskip=all -# return 0 -# fi -# (( i++ )) -# done -# fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_functions b/zsh_arm64/system/usr/share/zsh/functions/_functions deleted file mode 100644 index 4d33669..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_functions +++ /dev/null @@ -1,9 +0,0 @@ -#compdef unfunction - -local expl ffilt - -zstyle -t ":completion:${curcontext}:functions" prefix-needed && \ - [[ $PREFIX != [_.]* ]] && \ - ffilt='[(I)[^_.]*]' - -_wanted functions expl 'shell function' compadd -k "$@" - "functions$ffilt" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_generic b/zsh_arm64/system/usr/share/zsh/functions/_generic deleted file mode 100644 index 0a18b56..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_generic +++ /dev/null @@ -1,18 +0,0 @@ -#autoload - -if [[ -n $ZSH_TRACE_GENERIC_WIDGET ]]; then - local widget=$ZSH_TRACE_GENERIC_WIDGET - unset ZSH_TRACE_GENERIC_WIDGET - $widget _generic - return -fi - -local curcontext="${curcontext:-}" - -if [[ -z "$curcontext" ]]; then - curcontext="${WIDGET}:::" -else - curcontext="${WIDGET}:${curcontext#*:}" -fi - -_main_complete "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_globflags b/zsh_arm64/system/usr/share/zsh/functions/_globflags deleted file mode 100644 index 13ef14c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_globflags +++ /dev/null @@ -1,47 +0,0 @@ -#autoload - -# Complete 'globbing flags', i.e., '(#x)'; everything up to the '#' will -# have been "compset -P"'d by the caller. - -local ret=1 -local -a flags - -if compset -P a; then - _message -e number 'errors' - return -elif compset -P q; then - _globquals - return -elif compset -P 'c[0-9]##,'; then - _message -e number 'max repetitions' - return -elif compset -P c; then - _message -e number 'repetitions (min or exact)' - return -fi - -flags=( - 'i:case insensitive' - 'l:lower case characters match uppercase' - 'I:case sensitive matching' - 's:match start of string' - 'e:match end of string' - 'U:consider all characters to be one byte' - 'u:support multibyte characters in pattern' -) -[[ $compstate[context] = condition ]] && flags+=( - 'b:activate backreferences' - 'B:deactivate backreferences' - 'm:set reference to entire matched data' - 'M:deactivate m flag' -) - -_describe -t globflags "glob flag" flags -Q -S ')' && ret=0 -flags=( - 'a:approximate matching' - 'q:introduce glob qualifier' - 'c:match repetitions of preceding pattern' -) -_describe -t globflags "glob flag" flags -Q -S '' && ret=0 - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_globqual_delims b/zsh_arm64/system/usr/share/zsh/functions/_globqual_delims deleted file mode 100644 index bba4241..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_globqual_delims +++ /dev/null @@ -1,24 +0,0 @@ -#autoload - -# Helper for _globquals. Sets delim to delimiter to match. - -# don't restore special parameters -compstate[restore]=no - -delim=$PREFIX[1] -compset -p 1 - -# One of matching brackets? -# These don't actually work: the parser gets very confused. -local matchl="<({[" matchr=">)}]" -integer ind=${matchl[(I)$delim]} - -(( ind )) && delim=$matchr[ind] - -if compset -P "[^$delim]#$delim"; then - # Completely matched. - return 0 -else - # Still in delimiter - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_globquals b/zsh_arm64/system/usr/share/zsh/functions/_globquals deleted file mode 100644 index 915f97c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_globquals +++ /dev/null @@ -1,278 +0,0 @@ -#autoload - -local state=qual expl char delim timespec default MATCH -integer MBEGIN MEND -local -a alts tdisp sdisp tmatch smatch -local -A specmap - -while [[ -n $PREFIX ]]; do - char=$PREFIX[1] - compset -p 1 - case $char in - ([-/F.@=p*rwxAIERWXsStUG^MTNDn,]) - # no argument - ;; - - (%) - # optional b, c - if [[ $PREFIX[1] = [bc] ]]; then - compset -p 1 - fi - ;; - - (f) - if ! compset -P "[-=+][0-7?]##"; then - if [[ -z $PREFIX ]]; then - _delimiters qualifier-f - return - elif ! _globqual_delims; then - # still completing mode spec - _message -e modes "mode spec" - return - fi - fi - ;; - - (P) - # skip delimited prefix - if [[ -z $PREFIX ]]; then - _delimiters qualifier-P - return - elif ! _globqual_delims; then - # can't suggest anything here - _message -e prefix prefix - return - fi - ;; - - (e) - # complete/skip delimited command line - if [[ -z $PREFIX ]]; then - _delimiters qualifier-e - return - elif ! _globqual_delims; then - # still completing command to eval - compset -q - _normal - return - fi - ;; - - (+) - # complete/skip command name (no delimiters) - if [[ $PREFIX = [[:IDENT:]]# ]]; then - # either nothing there yet, or still on name - _command_names - return - fi - compset -P '[[:IDENT:]]##' - ;; - - (d) - # complete/skip device - if ! compset -p '[[:digit:]]##'; then - _message -e device-ids "device ID" - return - fi - ;; - - (l) - # complete/skip link count - if ! compset -P '([-+]|)[[:digit:]]##'; then - _message -e numbers "link count" - return - fi - ;; - - (u) - # complete/skip UID or delimited user - if ! compset -P '[[:digit:]]##'; then - if [[ -z $PREFIX ]]; then - _delimiters qualifier-u - return - elif ! _globqual_delims; then - # still completing user - _users -S $delim - return - fi - fi - ;; - - (g) - # complete/skip GID or delimited group - if ! compset -P '[[:digit:]]##'; then - if [[ -z $PREFIX ]]; then - _delimiters qualifier-g - return - elif ! _globqual_delims; then - # still completing group - _groups -S $delim - return - fi - fi - ;; - - ([amc]) - if ! compset -P '([Mwhmsd]|)([-+]|)<->'; then - # complete/skip relative time spec - alts=() - timespec=$PREFIX[1] - if ! compset -P '[Mwhmsd]' && [[ -z $PREFIX ]]; then - tdisp=( seconds minutes hours days weeks Months ) - tmatch=( s m h d w M ) - if zstyle -t ":completion:${curcontext}:time-specifiers" verbose; then - zstyle -s ":completion:${curcontext}:time-specifiers" list-separator sep || sep=-- - print -v tdisp -f "%s ${sep//(#m)[%\\]/$MATCH$MATCH} %s" ${tmatch:^^tdisp} - fi - alts+=( "time-specifiers:time specifier:compadd -E 0 -d tdisp -S '' -a tmatch" ) - fi - if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then - sdisp=( before exactly since ) - smatch=( - '' + ) - if zstyle -t ":completion:${curcontext}:senses" verbose; then - zstyle -s ":completion:${curcontext}:senses" list-separator sep || sep=-- - default=" [default exactly]" - sdisp=( "- $sep before" "+ $sep since" ) - smatch=( - + ) - else - sdisp=( before exactly since ) - smatch=( - '' + ) - fi - alts+=( "senses:sense${default}:compadd -E 0 -d sdisp -S '' -a smatch" ) - fi - specmap=( M months w weeks h hours m minutes s seconds '(|+|-|d)' days) - alts+=('digits:digit ('${${specmap[(K)${timespec:-d}]}:-invalid time specifier}'):_dates -f ${${timespec/[-+]/d}:-d} -S ""' ) - _alternative $alts - return - fi - ;; - - (L) - # complete/skip file size - if ! compset -P '([kKmMgGtTpP]|)([-+]|)<->'; then - # complete/skip size spec - alts=() - if ! compset -P '[kKmMgGtTpP]' && [[ -z $PREFIX ]]; then - alts+=( - "size-specifiers:size specifier:\ -((k\:kb m\:mb g\:gb t\:tb p\:512-byte\ blocks))") - fi - if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then - alts+=("senses:sense:((-\:less\ than +\:more\ than))") - fi - alts+=('digits:digit: ') - _alternative $alts - return - fi - ;; - - ([oO]) - # complete/skip sort spec - if ! compset -p 1; then - alts=( - "n:lexical order of name" - "L:size of file" - "l:number of hard links" - "a:last access time" - "m:last modification time" - "c:last inode change time" - "d:directory depth" - "N:no sorting" - "e:execute code" - "+:+ command name" - ) - _describe -t sort-specifiers "sort specifier" alts -Q -S '' - return - elif [[ $IPREFIX[-1] = e ]]; then - if [[ -z $PREFIX ]]; then - _delimiters qualifier-oe - return - elif ! _globqual_delims; then - compset -q - _normal - return - fi - elif [[ $IPREFIX[-1] = + ]]; then - if [[ $PREFIX = [[:IDENT:]]# ]]; then - # either nothing there yet, or still on name - _command_names - return - fi - fi - ;; - - (\[) - # complete/skip range: check for closing bracket - if ! compset -P "(-|)[[:digit:]]##(,(-|)[[:digit:]]##|)]"; then - if compset -P "(-|)[[:digit:]]##,"; then - _message "end of range" - else - _message "start of range" - fi - return - fi - ;; - - (:) - # complete modifiers and don't stop completing them - _history_modifiers q - return - ;; - esac -done - -case $state in - (qual) - local -a quals - quals=( - "/:directories" - "F:non-empty directories" - ".:plain files" - "@:symbolic links" - "=:sockets" - "p:named pipes (FIFOs)" - "*:executable plain files" - "%:device files" - "r:owner-readable" - "w:owner-writeable" - "x:owner-executable" - "A:group-readable" - "I:group-writeable" - "E:group-executable" - "R:world-readable" - "W:world-writeable" - "X:world-executable" - "s:setuid" - "S:setgid" - "t:sticky bit set" - "f:+ access rights" - "e:execute code" - "+:+ command name" - "d:+ device" - "l:+ link count" - "U:owned by EUID" - "G:owned by EGID" - "u:+ owning user" - "g:+ owning group" - "a:+ access time" - "m:+ modification time" - "c:+ inode change time" - "L:+ size" - "^:negate qualifiers" - "-:follow symlinks toggle" - "M:mark directories" - "T:mark types" - "N:use NULL_GLOB" - "D:glob dots" - "n:numeric glob sort" - "o:+ sort order, up" - "O:+ sort order, down" - "P:prepend word" - "Y:+ at most ARG matches" - "[:+ range of files" - "):end of qualifiers" - "\::modifier" - ) - _describe -t globquals "glob qualifier" quals -Q -S '' - ;; -esac diff --git a/zsh_arm64/system/usr/share/zsh/functions/_guard b/zsh_arm64/system/usr/share/zsh/functions/_guard deleted file mode 100644 index ff62981..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_guard +++ /dev/null @@ -1,12 +0,0 @@ -#autoload - -local garbage - -zparseopts -K -D -a garbage M: J: V: 1 2 n F: X: - -[[ "$PREFIX$SUFFIX" != $~1 ]] && return 1 - -shift -_message -e "$*" - -[[ -n "$PREFIX$SUFFIX" ]] diff --git a/zsh_arm64/system/usr/share/zsh/functions/_hash b/zsh_arm64/system/usr/share/zsh/functions/_hash deleted file mode 100644 index d4bb59d..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_hash +++ /dev/null @@ -1,41 +0,0 @@ -#compdef hash rehash - -local state line expl common_args curcontext="$curcontext" ret=1 -typeset -A opt_args - -common_args=( \ - '-d[use named directory hash table]' \ - '(-r -m -v)-f[rebuild hash table]' ) - -case ${service} in - hash) - _arguments -C -s -S \ - '(-f -m -v)-r[empty hash table]' \ - '(-f -r)-m[treat arguments as patterns]' \ - '(-f -r -m)-v[list entries as they are added]' \ - '(-f -r -v)-L[list in the form of calls to hash]' \ - "${common_args[@]}" \ - '(-d -f -r -m -v -L)*:hash:->hashval' && ret=0 - ;; - rehash) - _arguments -C -s ${common_args[@]} && return 0 - ;; -esac - -if [[ $state = hashval ]]; then - if (( $+opt_args[-d] )); then - if compset -P 1 '*='; then - _wanted -C value files expl directories _path_files -/ && ret=0 - else - _wanted -C name named-directories expl 'named directory' \ - compadd -q -S '=' -k nameddirs && ret=0 - fi - elif compset -P 1 '*='; then - _wanted -C value values expl 'executable file' _files -g '*(-*)' && ret=0 - else - curcontext="${curcontext%:*}:name" - _path_commands -q -S '=' && ret=0 - fi -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_history b/zsh_arm64/system/usr/share/zsh/functions/_history deleted file mode 100644 index cd69ca1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_history +++ /dev/null @@ -1,65 +0,0 @@ -#autoload - -# Hm, this *can* sensibly be used as a completer. But it could also be used -# as a utility function, so maybe it should be moved into another directory. -# Or maybe not. Hm. -# -# -# Complete words from the history -# -# Code taken from _history_complete_words. -# -# Available styles: -# -# sort -- sort matches lexically (default is to sort by age) -# remove-all-dups -- -# remove /all/ duplicate matches rather than just consecutives -# range -- range of history words to complete - -local opt expl max slice hmax=$#historywords beg=2 - -if zstyle -t ":completion:${curcontext}:" remove-all-dups; then - opt=- -else - opt=-1 -fi - -if zstyle -t ":completion:${curcontext}:" sort; then - opt="${opt}J" -else - opt="${opt}V" -fi - -if zstyle -s ":completion:${curcontext}:" range max; then - if [[ $max = *:* ]]; then - slice=${max#*:} - max=${max%:*} - else - slice=$max - fi - [[ max -gt hmax ]] && max=$hmax -else - max=$hmax - slice=$max -fi - -PREFIX="$IPREFIX$PREFIX" -IPREFIX= -SUFFIX="$SUFFIX$ISUFFIX" -ISUFFIX= - -# We skip the first element of historywords so the current word doesn't -# interfere with the completion - -local -a hslice -while [[ $compstate[nmatches] -eq 0 && beg -lt max ]]; do - if [[ -n $compstate[quote] ]] - then hslice=( ${(Q)historywords[beg,beg+slice]} ) - else hslice=( ${historywords[beg,beg+slice]} ) - fi - _wanted "$opt" history-words expl 'history word' \ - compadd -Q -a hslice - (( beg+=slice )) -done - -(( $compstate[nmatches] )) diff --git a/zsh_arm64/system/usr/share/zsh/functions/_history_complete_word b/zsh_arm64/system/usr/share/zsh/functions/_history_complete_word deleted file mode 100644 index fe2a846..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_history_complete_word +++ /dev/null @@ -1,121 +0,0 @@ -#compdef -K _history-complete-older complete-word \e/ _history-complete-newer complete-word \e, -# -# Complete words from the history -# -# by Adam Spiers, with help gratefully received from -# Sven Wischnowsky and Bart Schaefer -# -# Available styles: -# -# list -- avoid to display lists of available matches -# stop -- stop before looping at beginning and end of matches -# sort -- sort matches lexically (default is to sort by age) -# remove-all-dups -- -# remove /all/ duplicate matches rather than just consecutives -# range -- range of history words to complete - -_history_complete_word () { - eval "$_comp_setup" - - local expl direction stop curcontext="$curcontext" - - if [[ -z "$curcontext" ]]; then - curcontext=history-words::: - else - curcontext="history-words${curcontext#*:}" - fi - - if [[ $WIDGET = *newer ]]; then - direction=newer - else - direction=older - fi - - zstyle -t ":completion:${curcontext}:history-words" stop && stop=yes - - zstyle -T ":completion:${curcontext}:history-words" list || compstate[list]='' - - if [[ $LASTWIDGET = _history-complete-* && - ( -n "$compstate[old_list]" || -n $_hist_stop ) ]]; then - if [[ "$direction" == older ]]; then - if [[ $_hist_stop = new ]]; then - PREFIX=$_hist_old_prefix - _history_complete_word_gen_matches - compstate[insert]=2 - _hist_stop= - elif [[ $_hist_stop = old ]]; then - PREFIX=$_hist_old_prefix - _history_complete_word_gen_matches - compstate[insert]=1 - _hist_stop= - elif [[ compstate[old_insert] -lt _hist_menu_length ]]; then - compstate[old_list]=keep - (( compstate[insert] = compstate[old_insert] + 1 )) - elif [[ -n $stop ]]; then - _hist_stop=old - _message 'beginning of history reached' - return 1 - else - compstate[old_list]=keep - compstate[insert]=1 - fi - elif [[ "$direction" == 'newer' ]]; then - if [[ $_hist_stop = old ]]; then - PREFIX=$_hist_old_prefix - _history_complete_word_gen_matches - compstate[insert]=$(( $compstate[nmatches] - 1 )) - _hist_stop= - elif [[ $_hist_stop = new ]]; then - PREFIX=$_hist_old_prefix - _history_complete_word_gen_matches - compstate[insert]=$compstate[nmatches] - _hist_stop= - elif [[ compstate[old_insert] -gt 1 ]]; then - compstate[old_list]=keep - (( compstate[insert] = compstate[old_insert] - 1 )) - elif [[ -n $stop ]]; then - _hist_stop=new - _message 'end of history reached' - return 1 - else - compstate[old_list]=keep - compstate[insert]=$_hist_menu_length - fi - fi - return 0 - else - _hist_stop= - _hist_old_prefix="$PREFIX" - _history_complete_word_gen_matches - fi - - (( $compstate[nmatches] )) -} - -_history_complete_word_gen_matches () { - - [[ -n "$_hist_stop" ]] && PREFIX="$_hist_old_prefix" - - _main_complete _history - - zstyle -T ":completion:${curcontext}:history-words" list || compstate[list]= - - _hist_menu_length="$compstate[nmatches]" - - if [[ $_lastcomp[insert] != *unambig* ]]; then - case "$direction" in - newer) compstate[insert]=$_hist_menu_length - [[ -n "$_hist_stop" ]] && (( compstate[insert]-- )) - ;; - older) compstate[insert]=1 - [[ -n "$_hist_stop" ]] && (( compstate[insert]++ )) - ;; - esac - fi - - _hist_stop= - - return -} - -_history_complete_word "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_history_modifiers b/zsh_arm64/system/usr/share/zsh/functions/_history_modifiers deleted file mode 100644 index 1a049d6..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_history_modifiers +++ /dev/null @@ -1,89 +0,0 @@ -#autoload - -# Complete history-style modifiers; the first : will have -# been matched and compset -p 1'd. -# The single argument is the type of context: -# h history -# q glob qualifier -# p parameter - -local -a list - -local type=$1 delim expl -integer global - -while true; do - if [[ -n $PREFIX ]]; then - local char=$PREFIX[1] - - global=0 - compset -p 1 - case $char in - ([hretpqQxlu\&]) - # single character modifiers - ;; - - (s) - # match delimiter string delimiter string delimiter - if [[ -z $PREFIX ]]; then - _delimiters modifier-s - return - fi - delim=$PREFIX[1] - compset -p 1 - if ! compset -P "[^${delim}]#${delim}[^${delim}]#${delim}"; then - if compset -P "[^${delim}]#${delim}"; then - _message "replacement string" - else - _message "original string" - fi - return - fi - ;; - - (g) - global=1 - continue - ;; - esac - - # modifier completely matched, see what's next. - compset -P : && continue - # if there's something other than colon next, bummer - [[ -n $PREFIX ]] && return 1 - - list=("\::modifier") - [[ $type = q ]] && list+=("):end of qualifiers") - # strictly we want a normal suffix if end of qualifiers - _describe -t delimiters "delimiter" list -Q -S '' - return - else - list=( - "s:substitute string" - "&:repeat substitution" - ) - if (( ! global )); then - list+=( - "a:absolute path, resolve '..' lexically" - "A:as ':a', then resolve symlinks" - "c:PATH search for command" - "g:globally apply s or &" - "h:head - strip trailing path element" - "t:tail - strip directories" - "r:root - strip suffix" - "e:leave only extension" - "Q:strip quotes" - "P:realpath, resolve '..' physically" - "l:lower case all words" - "u:upper case all words" - ) - [[ $type = h ]] && list+=( - "p:print without executing" - "x:quote words, breaking on whitespace" - ) - [[ $type = [hp] ]] && list+=("q:quote to escape further substitutions") - fi - _describe -t modifiers "modifier" list -Q -S '' - return - fi -done diff --git a/zsh_arm64/system/usr/share/zsh/functions/_ignored b/zsh_arm64/system/usr/share/zsh/functions/_ignored deleted file mode 100644 index 00dfc42..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_ignored +++ /dev/null @@ -1,68 +0,0 @@ -#autoload - -# Use ignored matches. - -[[ _matcher_num -gt 1 || $compstate[ignored] -eq 0 ]] && return 1 - -local comp -integer ind - -if ! zstyle -a ":completion:${curcontext}:" completer comp; then - comp=( "${(@)_completers[1,_completer_num-1]}" ) - ind=${comp[(I)_ignored(|:*)]} - (( ind )) && comp=("${(@)comp[ind,-1]}") -fi - -local _comp_no_ignore=yes tmp expl \ - _completer _completer_num \ - _matcher _c_matcher _matchers _matcher_num - -_completer_num=1 - -for tmp in "$comp[@]"; do - if [[ "$tmp" = *:-* ]]; then - _completer="${${tmp%:*}[2,-1]//_/-}${tmp#*:}" - tmp="${tmp%:*}" - elif [[ $tmp = *:* ]]; then - _completer="${tmp#*:}" - tmp="${tmp%:*}" - else - _completer="${tmp[2,-1]//_/-}" - fi - curcontext="${curcontext/:[^:]#:/:${_completer}:}" - - zstyle -a ":completion:${curcontext}:" matcher-list _matchers || - _matchers=( '' ) - - _matcher_num=1 - _matcher='' - for _c_matcher in "$_matchers[@]"; do - if [[ "$_c_matcher" == +* ]]; then - _matcher="$_matcher $_c_matcher[2,-1]" - else - _matcher="$_c_matcher" - fi - if [[ "$tmp" != _ignored ]] && "$tmp"; then - if zstyle -s ":completion:${curcontext}:" single-ignored tmp && - [[ $compstate[old_list] != shown && - $compstate[nmatches] -eq 1 ]]; then - case "$tmp" in - show) compstate[insert]='' compstate[list]='list force' tmp='' ;; - menu) - compstate[insert]=menu - _description original expl original - compadd "$expl[@]" -S '' - "$PREFIX$SUFFIX" - ;; - esac - fi - - return 0 - fi - - (( _matcher_num++ )) - done - - (( _completer_num++ )) -done - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_in_vared b/zsh_arm64/system/usr/share/zsh/functions/_in_vared deleted file mode 100644 index c3c8a20..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_in_vared +++ /dev/null @@ -1,35 +0,0 @@ -#compdef -vared- - -local also - -# Completion inside vared. - -if [[ $compstate[vared] = *\[* ]]; then - if [[ $compstate[vared] = *\]* ]]; then - # vared on an array-element - compstate[parameter]=${${compstate[vared]%%\]*}//\[/-} - compstate[context]=value - also=-value- - else - # vared on an array-value - compstate[parameter]=${compstate[vared]%%\[*} - compstate[context]=value - also=-value- - fi -else - # vared on a parameter, let's see if it is an array - compstate[parameter]=$compstate[vared] - if [[ ${(tP)compstate[vared]} = *(array|assoc)* ]]; then - compstate[context]=array_value - also=-array-value- - else - compstate[context]=value - also=-value- - fi -fi - -# Don't insert TAB in first column. Never. - -compstate[insert]="${compstate[insert]//tab /}" - -_dispatch "$also" "$also" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_jobs b/zsh_arm64/system/usr/share/zsh/functions/_jobs deleted file mode 100644 index bc35c44..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_jobs +++ /dev/null @@ -1,84 +0,0 @@ -#autoload - -local expl disp jobs job jids pfx='%' desc how expls sep - -if [[ "$1" = -t ]]; then - zstyle -T ":completion:${curcontext}:jobs" prefix-needed && - [[ "$PREFIX" != %* && compstate[nmatches] -ne 0 ]] && return 1 - shift -fi -zstyle -t ":completion:${curcontext}:jobs" prefix-hidden && pfx='' -zstyle -T ":completion:${curcontext}:jobs" verbose && desc=yes - -if [[ "$1" = -r ]]; then - jids=( "${(@k)jobstates[(R)running*]}" ) - shift - expls='running job' -elif [[ "$1" = -s ]]; then - jids=( "${(@k)jobstates[(R)suspended*]}" ) - shift - expls='suspended job' -else - [[ "$1" = - ]] && shift - jids=( "${(@k)jobtexts}" ) - expls=job -fi - -if [[ -n "$desc" ]]; then - disp=() - zstyle -s ":completion:${curcontext}:jobs" list-separator sep || sep=-- - for job in "$jids[@]"; do - [[ -n "$desc" ]] && - disp=( "$disp[@]" "${pfx}${(r:2:: :)job} $sep ${(r:COLUMNS-8:: :)jobtexts[$job]}" ) - done -fi - -zstyle -s ":completion:${curcontext}:jobs" numbers how - -if [[ "$how" = (yes|true|on|1) ]]; then - jobs=( "$jids[@]" ) -else - local texts i text str tmp num max=0 - - # Find shortest unambiguous strings. - - texts=( "$jobtexts[@]" ) - jobs=() - for i in "$jids[@]"; do - text="$jobtexts[$i]" - str="${text%% *}" - if [[ "$text" = *\ * ]]; then - text="${text#* }" - else - text="" - fi - tmp=( "${(@M)texts:#${str}*}" ) - num=1 - while [[ -n "$text" && $#tmp -ge 2 ]]; do - str="${str} ${text%% *}" - if [[ "$text" = *\ * ]]; then - text="${text#* }" - else - text="" - fi - tmp=( "${(@M)texts:#${str}*}" ) - (( num++ )) - done - - [[ num -gt max ]] && max="$num" - - jobs=( "$jobs[@]" "$str" ) - done - - if [[ "$how" = [0-9]## && max -gt how ]]; then - jobs=( "$jids[@]" ) - else - [[ -z "$pfx" && -n "$desc" ]] && disp=( "${(@)disp#%}" ) - fi -fi - -if [[ -n "$desc" ]]; then - _wanted jobs expl "$expls" compadd "$@" -ld disp - "%$^jobs[@]" -else - _wanted jobs expl "$expls" compadd "$@" - "%$^jobs[@]" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_jobs_bg b/zsh_arm64/system/usr/share/zsh/functions/_jobs_bg deleted file mode 100644 index 0c18422..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_jobs_bg +++ /dev/null @@ -1,3 +0,0 @@ -#compdef bg - -_jobs -s "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_jobs_builtin b/zsh_arm64/system/usr/share/zsh/functions/_jobs_builtin deleted file mode 100644 index 70804cf..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_jobs_builtin +++ /dev/null @@ -1,10 +0,0 @@ -#compdef jobs - -_arguments -C -s \ - "(-d -l -p -r -s *)-Z[specify string to replace shell's argument and environment with]:string" \ - '(-Z)-d[show directory from which each job was started]' \ - '(-Z)-l[list process IDs]' \ - '(-Z)-p[list process groups]' \ - '(-Z -s)-r[list only running jobs]' \ - '(-Z -r)-s[list only stopped jobs]' \ - '(-Z)*::job:_jobs' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_jobs_fg b/zsh_arm64/system/usr/share/zsh/functions/_jobs_fg deleted file mode 100644 index 57117f0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_jobs_fg +++ /dev/null @@ -1,3 +0,0 @@ -#compdef disown fg - -_jobs "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_kill b/zsh_arm64/system/usr/share/zsh/functions/_kill deleted file mode 100644 index b9dfde3..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_kill +++ /dev/null @@ -1,22 +0,0 @@ -#compdef kill - -local curcontext="$curcontext" line state ret=1 -typeset -A opt_args - -_arguments -C \ - '(-s -l 1)-n[specify signal number]:signal number' \ - '(-n -l 1)-s[specify signal name]:signal:_signals -s' \ - '(-n -s)-l[list signal names or numbers of specified signals]:*:signal:_signals' \ - '(-n -s -l)1::signal:_signals -p -s' \ - '*:processes:->processes' && ret=0 - -if [[ -n "$state" ]]; then - local pgrp='process-groups:: _wanted ' - [[ -n "$opt_args[(i)-[ns]]${${(@)line:#--}}" && -prefix - ]] && pgrp+='-x ' - pgrp+="process-groups expl 'process-group' compadd - 0" - _alternative \ - 'processes:: _pids' \ - 'jobs:: _jobs -t' $pgrp && ret=0 -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_limit b/zsh_arm64/system/usr/share/zsh/functions/_limit deleted file mode 100644 index 852c55c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_limit +++ /dev/null @@ -1,9 +0,0 @@ -#compdef limit - -if ! ((CURRENT % 2)); then - _limits -elif [[ $PREFIX = u* ]]; then - compadd unlimited -else - _message -e values "number and scaling factor" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_limits b/zsh_arm64/system/usr/share/zsh/functions/_limits deleted file mode 100644 index 11ee7ef..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_limits +++ /dev/null @@ -1,5 +0,0 @@ -#compdef unlimit - -local expl - -_wanted limits expl 'process limit' compadd "$@" - ${${(f)"$(limit)"}%% *} diff --git a/zsh_arm64/system/usr/share/zsh/functions/_list b/zsh_arm64/system/usr/share/zsh/functions/_list deleted file mode 100644 index a9aa46d..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_list +++ /dev/null @@ -1,37 +0,0 @@ -#autoload - -# This completer function makes the other completer functions used -# insert possible completions only after the list has been shown at -# least once. - -[[ _matcher_num -gt 1 ]] && return 1 - -local pre suf expr - -# Get the strings to compare. - -if zstyle -t ":completion:${curcontext}:" word; then - pre="$HISTNO$LBUFFER" - suf="$RBUFFER" -else - pre="$PREFIX" - suf="$SUFFIX" -fi - -# Should we only show a list now? - -if zstyle -T ":completion:${curcontext}:" condition && - [[ "$pre" != "$_list_prefix" || "$suf" != "$_list_suffix" ]]; then - - # Yes. Tell the completion code about it and save the new values - # to compare the next time. - - compstate[insert]='' - compstate[list]='list force' - _list_prefix="$pre" - _list_suffix="$suf" -fi - -# We always return one, because we don't really do any work here. - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_main_complete b/zsh_arm64/system/usr/share/zsh/functions/_main_complete deleted file mode 100644 index aa24862..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_main_complete +++ /dev/null @@ -1,406 +0,0 @@ -#autoload - -# The main loop of the completion code. This is what is called when -# completion is attempted from the command line. - -# Note that this function is parsed before $_comp_setup is evaluated, -# so that it should make conservative assumptions about the setting -# of the various options that affect parsing. - -# In case non-standard separators are in use. -local IFS=$' \t\n\0' - -# If you want to complete only set or unset options for the unsetopt -# and setopt builtin, un-comment these lines: -# -# local _options_set _options_unset -# -# _options_set=(${(k)options[(R)on]}) -# _options_unset=(${(k)options[(R)off]}) -# -# This is needed because completion functions may set options locally -# which makes the output of setopt and unsetopt reflect a different -# state than the global one for which you are completing. - -eval "$_comp_setup" - -local func funcs ret=1 tmp _compskip format nm call match min max i num\ - _completers _completer _completer_num curtag _comp_force_list \ - _matchers _matcher _c_matcher _matcher_num _comp_tags _comp_mesg \ - mesg str context state state_descr line opt_args val_args \ - curcontext="$curcontext" \ - _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \ - _tags_level=0 \ - _saved_exact="${compstate[exact]}" \ - _saved_lastprompt="${compstate[last_prompt]}" \ - _saved_list="${compstate[list]}" \ - _saved_insert="${compstate[insert]}" \ - _saved_colors="$ZLS_COLORS" \ - _saved_colors_set=${+ZLS_COLORS} \ - _ambiguous_color='' -# Hide any '_comp_priv_prefix' variable that happens to be defined in the calling scope. -local _comp_priv_prefix -unset _comp_priv_prefix - -# _precommand sets this to indicate we are following a precommand modifier -local -a precommands - -typeset -U _lastdescr _comp_ignore _comp_colors - -{ - -[[ -z "$curcontext" ]] && curcontext=::: - -zstyle -s ":completion:${curcontext}:" insert-tab tmp || tmp=yes - -if [[ ( "$tmp" = *pending(|[[:blank:]]*) && PENDING -gt 0 ) || - ( "$tmp" = *pending=(#b)([0-9]##)(|[[:blank:]]*) && - PENDING -ge $match[1] ) ]]; then - compstate[insert]=tab - - return 0 -fi - -if [[ "$compstate[insert]" = tab* ]]; then - if [[ "$tmp" = (|*[[:blank:]])(yes|true|on|1)(|[[:blank:]]*) ]]; then - if [[ "$curcontext" != :* || -z "$compstate[vared]" ]] || - zstyle -t ":completion:vared${curcontext}:" insert-tab; then - return 0 - fi - fi - - compstate[insert]="${compstate[insert]//tab /}" -fi - -# Second attempt at GLOB_COMPLETE - -if [[ "$compstate[pattern_match]" = "*" && - "$_lastcomp[unambiguous]" = "$PREFIX" && - -n "$_lastcomp[unambiguous_cursor]" ]]; then - integer upos="$_lastcomp[unambiguous_cursor]" - SUFFIX="$PREFIX[upos,-1]$SUFFIX" - PREFIX="$PREFIX[1,upos-1]" -fi - -# Special completion contexts after `~' and `='. - -if [[ -z "$compstate[quote]" ]]; then - if [[ -o equals ]] && compset -P 1 '='; then - compstate[context]=equal - elif [[ "$PREFIX" != */* && "$PREFIX[1]" = '~' ]]; then - compset -p 1 - compstate[context]=tilde - fi -fi - -# Initial setup. - -_setup default -_def_menu_style=( "$_last_menu_style[@]" - -# We can't really do that because the current value of $MENUSELECT -# may be the one set by this function. -# There is a similar problem with $ZLS_COLORS in _setup. - -# ${MENUSELECT+select${MENUSELECT:+\=$MENUSELECT}} - - ) -_last_menu_style=() - -if zstyle -s ":completion:${curcontext}:default" list-prompt tmp; then - LISTPROMPT="$tmp" - zmodload -i zsh/complist -fi -if zstyle -s ":completion:${curcontext}:default" select-prompt tmp; then - MENUPROMPT="$tmp" - zmodload -i zsh/complist -fi -if zstyle -s ":completion:${curcontext}:default" select-scroll tmp; then - MENUSCROLL="$tmp" - zmodload -i zsh/complist -fi - -# Get the names of the completers to use in the positional parameters. - -if (( $# )); then - if [[ "$1" = - ]]; then - if [[ $# -lt 3 ]]; then - _completers=() - else - _completers=( "$2" ) - call=yes - fi - else - _completers=( "$@" ) - fi -else - zstyle -a ":completion:${curcontext}:" completer _completers || - _completers=( _complete _ignored ) -fi - -# And now just call the completer functions defined. - -_completer_num=1 - -# We assume localtraps to be in effect here ... -integer SECONDS=0 -TRAPINT() { - zle -M "Killed by signal in ${funcstack[2]} after ${SECONDS}s"; - zle -R - return 130 -} -TRAPQUIT() { - zle -M "Killed by signal in ${funcstack[2]} after ${SECONDS}s"; - zle -R - return 131 -} - -# Call the pre-functions. - -funcs=( "$compprefuncs[@]" ) -compprefuncs=() -for func in "$funcs[@]"; do - "$func" -done - -for tmp in "$_completers[@]"; do - - if [[ -n "$call" ]]; then - _completer="${tmp}" - elif [[ "$tmp" = *:-* ]]; then - _completer="${${tmp%:*}[2,-1]//_/-}${tmp#*:}" - tmp="${tmp%:*}" - elif [[ $tmp = *:* ]]; then - _completer="${tmp#*:}" - tmp="${tmp%:*}" - else - _completer="${tmp[2,-1]//_/-}" - fi - - curcontext="${curcontext/:[^:]#:/:${_completer}:}" - zstyle -t ":completion:${curcontext}:" show-completer && - zle -R "Trying completion for :completion:${curcontext}" - - zstyle -a ":completion:${curcontext}:" matcher-list _matchers || - _matchers=( '' ) - - _matcher_num=1 - _matcher='' - for _c_matcher in "$_matchers[@]"; do - if [[ "$_c_matcher" == +* ]]; then - _matcher="$_matcher $_c_matcher[2,-1]" - else - _matcher="$_c_matcher" - fi - - _comp_mesg= - if [[ -n "$call" ]]; then - if "${(@)argv[3,-1]}"; then - ret=0 - break 2 - fi - elif "$tmp"; then - ret=0 - break 2 - fi - (( _matcher_num++ )) - done - [[ -n "$_comp_mesg" ]] && break - - (( _completer_num++ )) -done - -curcontext="${curcontext/:[^:]#:/::}" -if [[ $compstate[old_list] = keep ]]; then - # We are keeping the old list of matches, so keep the - # number of matches we found last time rather than the - # number just generated. - nm=$_lastcomp[nmatches] -else - nm=$compstate[nmatches] -fi - -if [[ $compstate[old_list] = keep || nm -gt 1 ]]; then - [[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] && - _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) - - tmp=$(( compstate[list_lines] + BUFFERLINES + 1 )) - - _menu_style=( "$_menu_style[@]" "$_def_menu_style[@]" ) - - if [[ "$compstate[list]" = *list && tmp -gt LINES && - ( -n "$_menu_style[(r)select=long-list]" || - -n "$_menu_style[(r)(yes|true|on|1)=long-list]" ) ]]; then - compstate[insert]=menu - elif [[ "$compstate[insert]" = "$_saved_insert" ]]; then - if [[ -n "$compstate[insert]" && - -n "$_menu_style[(r)(yes|true|1|on)=long]" && tmp -gt LINES ]]; then - compstate[insert]=menu - else - sel=( "${(@M)_menu_style:#(yes|true|1|on)*}" ) - - if (( $#sel )); then - min=9999999 - for i in "$sel[@]"; do - if [[ "$i" = *\=[0-9]* ]]; then - num="${i#*\=}" - [[ num -lt 0 ]] && num=0 - elif [[ "$i" != *\=* ]]; then - num=0 - else - num=9999999 - fi - [[ num -lt min ]] && min="$num" - - (( min )) || break - done - fi - sel=( "${(@M)_menu_style:#(no|false|0|off)*}" ) - - if (( $#sel )); then - max=9999999 - for i in "$sel[@]"; do - if [[ "$i" = *\=[0-9]* ]]; then - num="${i#*\=}" - [[ num -lt 0 ]] && num=0 - elif [[ "$i" != *\=* ]]; then - num=0 - else - num=9999999 - fi - [[ num -lt max ]] && max="$num" - - (( max )) || break - done - fi - if [[ ( -n "$min" && nm -ge min && ( -z "$max" || nm -lt max ) ) || - ( -n "$_menu_style[(r)auto*]" && - "$compstate[insert]" = automenu ) ]]; then - compstate[insert]=menu - elif [[ -n "$max" && nm -ge max ]]; then - compstate[insert]=unambiguous - elif [[ -n "$_menu_style[(r)auto*]" && - "$compstate[insert]" != automenu ]]; then - compstate[insert]=automenu-unambiguous - fi - fi - fi - - if [[ "$compstate[insert]" = *menu* ]]; then - [[ "$MENUSELECT" = 00 ]] && MENUSELECT=0 - if [[ -n "$_menu_style[(r)no-select*]" ]]; then - unset MENUSELECT - elif [[ -n "$_menu_style[(r)select=long*]" ]]; then - if [[ tmp -gt LINES ]]; then - zmodload -i zsh/complist - MENUSELECT=00 - fi - fi - if [[ "$MENUSELECT" != 00 ]]; then - sel=( "${(@M)_menu_style:#select*}" ) - - if (( $#sel )); then - min=9999999 - for i in "$sel[@]"; do - if [[ "$i" = *\=[0-9]* ]]; then - num="${i#*\=}" - [[ num -lt 0 ]] && num=0 - elif [[ "$i" != *\=* ]]; then - num=0 - else - num=9999999 - fi - [[ num -lt min ]] && min="$num" - - (( min )) || break - done - - zmodload -i zsh/complist - MENUSELECT="$min" - else - unset MENUSELECT - fi - fi - if [[ -n "$MENUSELECT" ]]; then - if [[ -n "$_menu_style[(r)interactive*]" ]]; then - MENUMODE=interactive - elif [[ -n "$_menu_style[(r)search*]" ]]; then - if [[ -n "$_menu_style[(r)*backward*]" ]]; then - MENUMODE=search-backward - else - MENUMODE=search-forward - fi - else - unset MENUMODE - fi - fi - fi -elif [[ nm -lt 1 && -n "$_comp_mesg" ]]; then - compstate[insert]='' - compstate[list]='list force' -elif [[ nm -eq 0 && -z "$_comp_mesg" && - $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] && - zstyle -s ":completion:${curcontext}:warnings" format format; then - - compstate[list]='list force' - compstate[insert]='' - - tmp=( "\`${(@)^_lastdescr:#}'" ) - - case $#tmp in - 1) str="$tmp[1]";; - 2) str="$tmp[1] or $tmp[2]";; - *) str="${(j:, :)tmp[1,-2]}, or $tmp[-1]";; - esac - - _setup warnings - zformat -f mesg "$format" "d:$str" "D:${(F)${(@)_lastdescr:#}}" - compadd -x "$mesg" -fi - -if [[ -n "$_ambiguous_color" ]]; then - local toquote='[=\(\)\|~^?*[\]#<>]' - local prefix=${${compstate[unambiguous]}[1,${compstate[unambiguous_cursor]}-1]} - [[ -n $prefix ]] && - _comp_colors+=( "=(#i)${prefix[1,-2]//?/(}${prefix[1,-2]//(#m)?/${MATCH/$~toquote/\\$MATCH}|)}${prefix[-1]//(#m)$~toquote/\\$MATCH}(#b)(?|)*==$_ambiguous_color" ) -fi - -[[ "$_comp_force_list" = always || - ( "$_comp_force_list" = ?* && nm -ge _comp_force_list ) ]] && - compstate[list]="${compstate[list]//messages} force" - -} always { - # Stuff we always do to clean up. - if [[ "$compstate[old_list]" = keep ]]; then - if [[ $_saved_colors_set = 1 ]]; then - ZLS_COLORS="$_saved_colors" - else - unset ZLS_COLORS - fi - elif (( $#_comp_colors )); then - ZLS_COLORS="${(j.:.)_comp_colors}" - else - unset ZLS_COLORS - fi -} - -# Now call the post-functions. - -funcs=( "$comppostfuncs[@]" ) -comppostfuncs=() -for func in "$funcs[@]"; do - "$func" -done - -_lastcomp=( "${(@kv)compstate}" ) -_lastcomp[nmatches]=$nm -_lastcomp[completer]="$_completer" -_lastcomp[prefix]="$PREFIX" -_lastcomp[suffix]="$SUFFIX" -_lastcomp[iprefix]="$IPREFIX" -_lastcomp[isuffix]="$ISUFFIX" -_lastcomp[qiprefix]="$QIPREFIX" -_lastcomp[qisuffix]="$QISUFFIX" -_lastcomp[tags]="$_comp_tags" - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_match b/zsh_arm64/system/usr/share/zsh/functions/_match deleted file mode 100644 index a6aaa3f..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_match +++ /dev/null @@ -1,81 +0,0 @@ -#autoload - -# This is intended to be used as a completer function after the normal -# completer as in: `zstyle ":completion:::::" completer _complete _match'. -# It temporarily switches on pattern matching, allowing you to try -# completion on patterns without having to setopt glob_complete. -# -# Note, however, that this is only really useful if you don't use the -# expand-or-complete function because otherwise the pattern will -# be expanded using globbing. - -### Shouldn't be needed any more: [[ _matcher_num -gt 1 ]] && return 1 - -local tmp opm="$compstate[pattern_match]" ret=1 orig ins -local oms="$_old_match_string" -local ocsi="$compstate[insert]" ocspi="$compstate[pattern_insert]" - -# Do nothing if we don't have a pattern. - -tmp="${${:-$PREFIX$SUFFIX}#[~=]}" -[[ "$tmp:q" = "$tmp" ]] && return 1 - -_old_match_string="$PREFIX$SUFFIX$HISTNO" - -_tags matches original - -zstyle -s ":completion:${curcontext}:" match-original orig -zstyle -s ":completion:${curcontext}:" insert-unambiguous ins - -# Try completion without inserting a `*'? - -if [[ -n "$orig" ]]; then - compstate[pattern_match]='-' - _complete && ret=0 - compstate[pattern_match]="$opm" - - # No completion with inserting `*'? - - [[ ret -eq 1 && "$orig" = only ]] && return 1 -fi - -if (( ret )); then - compstate[pattern_match]='*' - _complete && ret=0 - compstate[pattern_match]="$opm" -fi - -if (( ! ret )); then - - if [[ "$ins" = pattern && $compstate[nmatches] -gt 1 ]]; then - - [[ "$oms" = "$PREFIX$SUFFIX$HISTNO" && - "$compstate[insert]" = automenu-unambiguous ]] && - compstate[insert]=automenu - [[ "$compstate[insert]" != *menu ]] && - compstate[pattern_insert]= compstate[insert]= - -# We tried to be clever here, making completion insert unambiguous -# expansions as early as possible, but this is really hard to test -# and the code below probably does more harm than good. -# -# [[ $compstate[unambiguous_cursor] -gt $#compstate[unambiguous] ]] && -# ins=yes compstate[insert]="$ocsi" compstate[pattern_insert]="$ocspi" - fi - - if [[ "$ins" = (true|yes|on|1) && - $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] - then - compstate[pattern_insert]=unambiguous - elif _requested original && - { [[ compstate[nmatches] -gt 1 ]] || - zstyle -t ":completion:${curcontext}:" original }; then - local expl - - _description -V original expl original - - compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX" - fi -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_math b/zsh_arm64/system/usr/share/zsh/functions/_math deleted file mode 100644 index f82f1c0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_math +++ /dev/null @@ -1,14 +0,0 @@ -#compdef -math- let - -if [[ "$PREFIX" = *[^a-zA-Z0-9_]* ]]; then - IPREFIX="$IPREFIX${PREFIX%%[a-zA-Z0-9_]#}" - PREFIX="${PREFIX##*[^a-zA-Z0-9_]}" -fi -if [[ "$SUFFIX" = *[^a-zA-Z0-9_]* ]]; then - ISUFFIX="${SUFFIX##[a-zA-Z0-9_]#}$ISUFFIX" - SUFFIX="${SUFFIX%%[^a-zA-Z0-9_]*}" -fi - -_alternative 'math-parameters:math parameter: _math_params' \ - 'user-math-functions:user math function: _user_math_func' \ - 'module-math-functions:math function from zsh/mathfunc: _module_math_func' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_math_params b/zsh_arm64/system/usr/share/zsh/functions/_math_params deleted file mode 100644 index 8a4b9e1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_math_params +++ /dev/null @@ -1,3 +0,0 @@ -#autoload - -_parameters -g '(integer|float)*' || _parameters diff --git a/zsh_arm64/system/usr/share/zsh/functions/_menu b/zsh_arm64/system/usr/share/zsh/functions/_menu deleted file mode 100644 index 0e12cb7..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_menu +++ /dev/null @@ -1,23 +0,0 @@ -#autoload - -[[ _matcher_num -gt 1 ]] && return 1 - -# This completer is an example showing how menu completion can be -# implemented with the new completion system. -# Use this one before the normal _complete completer, as in: -# -# zstyle ":completion:::::" completer _menu _complete - -if [[ -n "$compstate[old_list]" ]]; then - - # We have an old list, keep it and insert the next match. - - compstate[old_list]=keep - compstate[insert]=$((compstate[old_insert]+1)) -else - # No old list, make completion insert the first match. - - compstate[insert]=1 -fi - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_mere b/zsh_arm64/system/usr/share/zsh/functions/_mere deleted file mode 100644 index bd051e9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_mere +++ /dev/null @@ -1,3 +0,0 @@ -#compdef mere - -_files -g '*.[1-9]([a-z]|)(-.) *.man(-.)' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_message b/zsh_arm64/system/usr/share/zsh/functions/_message deleted file mode 100644 index 4d5645e..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_message +++ /dev/null @@ -1,45 +0,0 @@ -#autoload - -local format raw gopt - -if [[ "$1" = -e ]]; then - local expl ret=1 tag - - _comp_mesg=yes - - if (( $# > 2 )); then - tag="$2" - shift - else - tag="$curtag" - fi - _tags "$tag" && while _next_label "$tag" expl "$2"; do - compadd ${expl:/-X/-x} - ret=0 - done - - (( ! $compstate[nmatches] )) && [[ $compstate[insert] = *unambiguous* ]] && - compstate[insert]= - - return ret -fi - -gopt=() -zparseopts -D -a gopt 1 2 V J - -_tags messages || return 1 - -if [[ "$1" = -r ]]; then - raw=yes - shift - format="$1" -else - zstyle -s ":completion:${curcontext}:messages" format format || - zstyle -s ":completion:${curcontext}:descriptions" format format -fi - -if [[ -n "$format$raw" ]]; then - [[ -z "$raw" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}" - builtin compadd "$gopt[@]" -x "$format" - _comp_mesg=yes -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_module_math_func b/zsh_arm64/system/usr/share/zsh/functions/_module_math_func deleted file mode 100644 index 5044bdf..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_module_math_func +++ /dev/null @@ -1,12 +0,0 @@ -#autoload - -local mod -local -a funcs alts -local -a modules=( example mathfunc system ) - -for mod in $modules; do - funcs=( ${${${(f)"$(zmodload -Fl zsh/$mod 2>/dev/null)"}:#^+f:*}##+f:} ) - alts+=( "module-math-functions.${mod}:math function from zsh/${mod}:compadd -S '(' $funcs" ) -done - -_alternative $alts diff --git a/zsh_arm64/system/usr/share/zsh/functions/_most_recent_file b/zsh_arm64/system/usr/share/zsh/functions/_most_recent_file deleted file mode 100644 index e72cf5e..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_most_recent_file +++ /dev/null @@ -1,24 +0,0 @@ -#compdef -k complete-word \C-xm - -# Complete the most recently modified file matching the pattern on the line -# so far: globbing is active, i.e. *.txt will be expanded to the most recent -# file ending in .txt -# -# With a prefix argument, select the Nth most recent matching file; -# negative arguments work in the opposite direction, so for example -# `Esc - \C-x m' gets you the oldest file. - -local file tilde etilde -if [[ $PREFIX = \~*/* ]]; then - tilde=${PREFIX%%/*} - etilde=${~tilde} 2>/dev/null - # PREFIX and SUFFIX have full command line quoting in, but we want - # any globbing characters which are quoted to stay quoted. - eval "file=($PREFIX*$SUFFIX(om[${NUMERIC:-1}]N))" - file=(${file/#$etilde}) - file=($tilde${(q)^file}) -else - eval "file=($PREFIX*$SUFFIX(om[${NUMERIC:-1}]N))" - file=(${(q)file}) -fi -(( $#file )) && compadd -U -i "$IPREFIX" -I "$ISUFFIX" -f -Q -- $file diff --git a/zsh_arm64/system/usr/share/zsh/functions/_multi_parts b/zsh_arm64/system/usr/share/zsh/functions/_multi_parts deleted file mode 100644 index 12ff965..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_multi_parts +++ /dev/null @@ -1,261 +0,0 @@ -#autoload - -# This gets two arguments, a separator (which should be only one -# character) and an array. As usual, the array may be given by it's -# name or literal as in `(foo bar baz)' (words separated by spaces in -# parentheses). -# The parts of words from the array that are separated by the -# separator character are then completed independently. - -local sep pref npref i tmp2 group expl menu pre suf opre osuf orig cpre -local opts sopts matcher imm -typeset -U tmp1 matches - -# Get the options. - -zparseopts -D -a sopts \ - 'J+:=group' 'V+:=group' 'X+:=expl' 'P:=opts' 'F:=opts' \ - S: r: R: q 1 2 n f 'M+:=matcher' 'i=imm' - -sopts=( "$sopts[@]" "$opts[@]" ) -if (( $#matcher )); then - matcher="${matcher[2]}" -else - matcher= -fi - -# Get the arguments, first the separator, then the array. The array is -# stored in `tmp1'. Further on the array `matches' will always contain -# those words from the original array that still match everything we have -# tried to match while we walk through the string from the line. - -sep="$1" -if [[ "${2[1]}" = '(' ]]; then - tmp1=( ${=2[2,-2]} ) -else - tmp1=( "${(@P)2}" ) -fi - -# In `pre' and `suf' we will hold the prefix and the suffix from the -# line while we walk through them. The original string are used -# temporarily for matching. - -pre="$PREFIX" -suf="$SUFFIX" -opre="$PREFIX" -osuf="$SUFFIX" -orig="$PREFIX$SUFFIX" - -# Special handling for menu completion? - -[[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" || - ( $#compstate[pattern_match] -ne 0 && - "$orig" != "${orig:q}" ) ]] && menu=yes - -# In `pref' we collect the unambiguous prefix path. - -pref='' - -# If the string from the line matches at least one of the strings, -# we use only the matching strings. - -compadd -O matches -M "r:|${sep}=* r:|=* $matcher" -a tmp1 - -(( $#matches )) || matches=( "$tmp1[@]" ) - -while true; do - - # Get the prefix and suffix for matching. - - if [[ "$pre" = *${sep}* ]]; then - PREFIX="${pre%%${sep}*}" - SUFFIX="" - else - PREFIX="${pre}" - SUFFIX="${suf%%${sep}*}" - fi - - # Check if the component for some of the possible matches is equal - # to the string from the line. If there are such strings, we directly - # use the stuff from the line. This avoids having `foo' complete to - # both `foo' and `foobar'. - - if [[ -n "$PREFIX$SUFFIX" || "$pre" = ${sep}* ]]; then - tmp1=( "${(@M)matches:#${PREFIX}${SUFFIX}${sep}*}" ) - else - tmp1=() - fi - - if (( $#tmp1 )); then - npref="${PREFIX}${SUFFIX}${sep}" - else - # No exact match, see how many strings match what's on the line. - - builtin compadd -O tmp1 -M "r:|${sep}=* r:|=* $matcher" - "${(@)${(@)matches%%${sep}*}:#}" - - [[ $#tmp1 -eq 0 && -n "$_comp_correct" ]] && - compadd -O tmp1 -M "r:|${sep}=* r:|=* $matcher" - "${(@)${(@)matches%%${sep}*}:#}" - - if [[ $#tmp1 -eq 1 ]]; then - - # Only one match. If there are still separators from the line - # we just accept this component. Otherwise we insert what we - # have collected, probably giving it a separator character - # as a suffix. - - if [[ "$pre$suf" = *${sep}* ]]; then - npref="${tmp1[1]}${sep}" - else - matches=( "${(@M)matches:#${tmp1[1]}*}" ) - - PREFIX="${cpre}${pre}" - SUFFIX="$suf" - - if [[ $#imm -ne 0 && $#matches -eq 1 ]] || - zstyle -t ":completion:${curcontext}:" expand suffix; then - compadd "$group[@]" "$expl[@]" "$sopts[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - $pref$matches - else - if (( $matches[(I)${tmp1[1]}${sep}*] )); then - compadd "$group[@]" "$expl[@]" -p "$pref" -r "$sep" -S "$sep" "$opts[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - "$tmp1[1]" - else - compadd "$group[@]" "$expl[@]" -p "$pref" "$sopts[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - "$tmp1[1]" - fi - fi - return - fi - elif (( $#tmp1 )); then - local ret=1 - - # More than one match. First we get all strings that match the - # rest from the line. - - PREFIX="$pre" - SUFFIX="$suf" - compadd -O matches -M "r:|${sep}=* r:|=* $matcher" -a matches - - if [[ "$pre" = *${sep}* ]]; then - PREFIX="${cpre}${pre%%${sep}*}" - SUFFIX="${sep}${pre#*${sep}}${suf}" - else - PREFIX="${cpre}${pre}" - SUFFIX="$suf" - fi - - # The purpose of this check (or one purpose, anyway) seems to be to ensure - # that the suffix for the current segment on the command line doesn't - # match across segments. For example, we want $matches for ac to - # include abc/d, but not abd/c. If we don't have anything on the command - # line for this segment, though, we can skip it. (The difference is only - # noticeable when there are a huge number of possibilities) - [[ -n $pre$suf ]] && - matches=( ${(@M)matches:#(${(j<|>)~${(@b)tmp1}})*} ) - - if ! zstyle -t ":completion:${curcontext}:" expand suffix || - [[ -n "$menu" || -z "$compstate[insert]" ]]; then - - # With menu completion we add only the ambiguous component with - # the prefix collected and a separator for the matches that - # have more components. - - tmp2="$pre$suf" - if [[ "$tmp2" = *${sep}* ]]; then - tmp2=(-s "${sep}${tmp2#*${sep}}") - else - tmp2=() - fi - - - compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ - -p "$pref" "$tmp2[@]" -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)${(@)${(@M)matches:#*${sep}}%%${sep}*}:#}" && ret=0 - (( $matches[(I)${sep}*] )) && - compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ - -p "$pref" \ - -M "r:|${sep}=* r:|=* $matcher" - "$sep" && ret=0 - compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \ - -p "$pref" "$tmp2[@]" -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)${(@)${(@M)matches:#*?${sep}?*}%%${sep}*}:#}" && ret=0 - compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" "$tmp2[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)matches:#*${sep}*}" && ret=0 - else - # With normal completion we add all matches one-by-one with - # the unmatched part as a suffix. This will insert the longest - # unambiguous string for all matching strings. - - compadd "$group[@]" "$expl[@]" "$opts[@]" \ - -p "$pref" -s "${i#*${sep}}" \ - -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)${(@)${(@M)matches:#*${sep}*}%%${sep}*}:#}" && ret=0 - compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" \ - -M "r:|${sep}=* r:|=* $matcher" - \ - "${(@)matches:#*${sep}*}" && ret=0 - fi - return ret - else - # We are here if no string matched what's on the line. In this - # case we insert the expanded prefix we collected if it differs - # from the original string from the line. - - { ! zstyle -t ":completion:${curcontext}:" expand prefix || - [[ "$orig" = "$pref$pre$suf" ]] } && return 1 - - PREFIX="${cpre}${pre}" - SUFFIX="$suf" - - if [[ -n "$suf" ]]; then - compadd "$group[@]" "$expl[@]" -s "$suf" "$sopts[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - "$pref$pre" - else - compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - "$pref$pre" - fi - return - fi - fi - - # We just accepted and/or expanded a component from the line. We - # remove it from the matches (using only those that have a least - # the skipped string) and ad it the `pref'. - - matches=( "${(@)${(@)${(@M)matches:#${npref}*}#*${sep}}:#}" ) - pref="$pref$npref" - - # Now we set `pre' and `suf' to their new values. - - if [[ "$pre" = *${sep}* ]]; then - cpre="${cpre}${pre%%${sep}*}${sep}" - pre="${pre#*${sep}}" - elif [[ "$suf" = *${sep}* ]]; then - cpre="${cpre}${pre}${suf%%${sep}*}${sep}" - pre="${suf#*${sep}}" - suf="" - else - # The string from the line is fully handled. If we collected an - # unambiguous prefix and that differs from the original string, - # we insert it. - - PREFIX="${opre}${osuf}" - SUFFIX="" - - if [[ -n "$pref" && "$orig" != "$pref" ]]; then - if [[ "$pref" = *${sep}*${sep} ]]; then - compadd "$group[@]" "$expl[@]" "$opts[@]" \ - -p "${pref%${sep}*${sep}}${sep}" -S "$sep" \ - -M "r:|${sep}=* r:|=* $matcher" - "${${pref%${sep}}##*${sep}}" - - elif [[ "$pref" = *${sep}* ]]; then - compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ - -p "${pref%${sep}*}${sep}" \ - -M "r:|${sep}=* r:|=* $matcher" - "${pref##*${sep}}" - else - compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \ - -M "r:|${sep}=* r:|=* $matcher" - "$pref" - fi - fi - return - fi -done diff --git a/zsh_arm64/system/usr/share/zsh/functions/_next_label b/zsh_arm64/system/usr/share/zsh/functions/_next_label deleted file mode 100644 index 64506d0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_next_label +++ /dev/null @@ -1,25 +0,0 @@ -#autoload - -local __gopt __descr __spec - -__gopt=() -zparseopts -D -a __gopt 1 2 V J x - -if comptags -A "$1" curtag __spec; then - (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" - _tags_level=$#funcstack - _comp_tags="$_comp_tags $__spec " - if [[ "$curtag" = *[^\\]:* ]]; then - zformat -f __descr "${curtag#*:}" "d:$3" - _description "$__gopt[@]" "${curtag%:*}" "$2" "$__descr" - curtag="${curtag%:*}" - set -A $2 "${(P@)2}" "${(@)argv[4,-1]}" - else - _description "$__gopt[@]" "$curtag" "$2" "$3" - set -A $2 "${(@)argv[4,-1]}" "${(P@)2}" - fi - - return 0 -fi - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_next_tags b/zsh_arm64/system/usr/share/zsh/functions/_next_tags deleted file mode 100644 index 8522d7c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_next_tags +++ /dev/null @@ -1,141 +0,0 @@ -#compdef -k list-choices \C-xn - -# Main widget. - -_next_tags() { - eval "$_comp_setup" - - local ins ops="$PREFIX$SUFFIX" - - unfunction _all_labels _next_label - - _all_labels() { - local __gopt __len __tmp __pre __suf __ret=1 __descr __spec __prev - - if [[ "$1" = - ]]; then - __prev=- - shift - fi - - __gopt=() - zparseopts -D -a __gopt 1 2 V J x - - __tmp=${argv[(ib:4:)-]} - __len=$# - if [[ __tmp -lt __len ]]; then - __pre=$(( __tmp-1 )) - __suf=$__tmp - elif [[ __tmp -eq $# ]]; then - __pre=-2 - __suf=$(( __len+1 )) - else - __pre=4 - __suf=5 - fi - - while comptags "-A$__prev" "$1" curtag __spec; do - (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" - _tags_level=$#funcstack - [[ "$_next_tags_not" = *\ ${__spec}\ * ]] && continue - _comp_tags+=" $__spec " - if [[ "$curtag" = *[^\\]:* ]]; then - zformat -f __descr "${curtag#*:}" "d:$3" - _description "$__gopt[@]" "${curtag%:*}" "$2" "$__descr" - curtag="${curtag%:*}" - - "$4" "${(P@)2}" "${(@)argv[5,-1]}" && __ret=0 - else - _description "$__gopt[@]" "$curtag" "$2" "$3" - - "${(@)argv[4,__pre]}" "${(P@)2}" "${(@)argv[__suf,-1]}" && __ret=0 - fi - done - - return __ret - } - - _next_label() { - local __gopt __descr __spec - - __gopt=() - zparseopts -D -a __gopt 1 2 V J x - - if comptags -A "$1" curtag __spec; then - (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }" - _tags_level=$#funcstack - [[ "$_next_tags_not" = *\ ${__spec}\ * ]] && continue - _comp_tags+=" $__spec " - if [[ "$curtag" = *[^\\]:* ]]; then - zformat -f __descr "${curtag#*:}" "d:$3" - _description "$__gopt[@]" "${curtag%:*}" "$2" "$__descr" - curtag="${curtag%:*}" - set -A $2 "${(P@)2}" "${(@)argv[4,-1]}" - else - _description "$__gopt[@]" "$curtag" "$2" "$3" - set -A $2 "${(@)argv[4,-1]}" "${(P@)2}" - fi - - return 0 - fi - - return 1 - } - - if [[ "${LBUFFER%${PREFIX}}" = "$_next_tags_pre" ]]; then - PREFIX="$_next_tags_pfx" - SUFFIX="$_next_tags_sfx" - else - _next_tags_pre="${LBUFFER%${PREFIX}}" - if [[ "$LASTWIDGET" = (_next_tags|list-*|*complete*) ]]; then - PREFIX="$_lastcomp[prefix]" - SUFFIX="$_lastcomp[suffix]" - fi - fi - - _next_tags_not+=" $_lastcomp[tags]" - _next_tags_pfx="$PREFIX" - _next_tags_sfx="$SUFFIX" - - ins="${compstate[old_insert]:+1}" - - _main_complete _complete _next_tags_completer - - [[ $compstate[insert] = automenu ]] && compstate[insert]=automenu-unambiguous - [[ $compstate[insert] = *unambiguous && -n "$ops" && - -z "$_lastcomp[unambiguous]" ]] && compadd -Uns "$SUFFIX" - "$PREFIX" - - compstate[insert]="$ins" - compstate[list]='list force' - - compprefuncs+=( _next_tags_pre ) -} - -# Completer, for wrap-around. - -_next_tags_completer() { - _next_tags_not= - - _complete -} - -# Pre-completion function. - -_next_tags_pre() { - - # Probably `remove' our label functions. A better test would be nice, but - # I think one should still be able to edit the current word between - # attempts to complete it. - - if [[ -n $compstate[old_insert] && $WIDGET != _next_tags ]]; then - compstate[old_list]=keep - compstate[insert]=menu:2 - return 0 - elif [[ ${LBUFFER%${PREFIX}} != ${_next_tags_pre}* ]]; then - unfunction _all_labels _next_label - autoload -Uz _all_labels _next_label - else - compprefuncs+=( _next_tags_pre ) - fi -} - -_next_tags "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_normal b/zsh_arm64/system/usr/share/zsh/functions/_normal deleted file mode 100644 index dd607d2..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_normal +++ /dev/null @@ -1,41 +0,0 @@ -#compdef -command-line- - -local _comp_command1 _comp_command2 _comp_command skip - -if [[ "$1" = -s ]]; then - skip=(-s) -else - skip=() - _compskip='' -fi - -# Check for a history reference to complete modifiers. -# $PREFIX has a quoted form of the !, so we can't test that -# (it might the start of a real argument), but words has the -# raw McCoy. -if [[ -o BANG_HIST && - ( ( $words[CURRENT] = \!*: && -z $compstate[quote] ) || - ( $words[CURRENT] = \"\!*: && $compstate[all_quotes] = \" ) ) ]]; then - # This looks like a real history expansion; in that case - # we'd better put the !'s back the way pfalstad intended. - PREFIX=${PREFIX//\\!/!} - compset -P '*:' - _history_modifiers h - return -fi - -# Completing in command position? - -if [[ CURRENT -eq 1 ]]; then - curcontext="${curcontext%:*:*}:-command-:" - - comp="$_comps[-command-]" - [[ -n "$comp" ]] && eval "$comp" && return - - return 1 -fi - -_set_command - -_dispatch "$skip[@]" "$_comp_command" \ - "$_comp_command1" "$_comp_command2" -default- diff --git a/zsh_arm64/system/usr/share/zsh/functions/_nothing b/zsh_arm64/system/usr/share/zsh/functions/_nothing deleted file mode 100644 index 1f69155..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_nothing +++ /dev/null @@ -1,3 +0,0 @@ -#compdef true false log times clear logname whoami sync - -_message 'no argument or option' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_oldlist b/zsh_arm64/system/usr/share/zsh/functions/_oldlist deleted file mode 100644 index 1cb3760..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_oldlist +++ /dev/null @@ -1,57 +0,0 @@ -#autoload - -[[ _matcher_num -gt 1 || $_lastcomp[nmatches] -eq 0 ]] && return 1 - -local list - -zstyle -s ":completion:${curcontext}:" old-list list - -# If this is a listing widget and there is already an old list, -# and either the style :oldlist:old-list is `always', or it is not `never' -# and the list is not already shown, then use the existing list for listing -# (even if it was generated by another widget). -# Do this also if there is an old list and it was generated by the -# completer named by the oldlist_list key. - -if [[ -n $compstate[old_list] && $list != never && - $LASTWIDGET != _complete_help && $WIDGET != _complete_help ]]; then - if [[ $WIDGETSTYLE = *list* && ( $list = always || $list != shown ) ]]; then - compstate[old_list]=keep - return 0 - elif [[ $list = *${_lastcomp[completer]}* ]]; then - [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single - compstate[old_list]=keep - if [[ -o automenu ]]; then - compstate[insert]=menu - else - compadd -Qs "$SUFFIX" - "$PREFIX" - fi - return 0 - fi -fi - -# If this is a completion widget, and we have a completion inserted already, -# and the style :oldlist:old-menu is `true', then we cycle through the -# existing list (even if it was generated by another widget). - -if [[ -z $compstate[old_insert] && -n $compstate[old_list] && - ( $_lastcomp[nmatches] -ne 0 || $WIDGET != $LASTWIDGET ) && - $LASTWIDGET != _complete_help && $WIDGET != _complete_help ]]; then - compstate[old_list]=keep - return 0 -elif [[ $WIDGETSTYLE = *complete(|-prefix|-word) ]] && - zstyle -T ":completion:${curcontext}:" old-menu; then - if [[ -n $compstate[old_insert] ]]; then - compstate[old_list]=keep - if [[ $WIDGETSTYLE = *reverse* ]]; then - compstate[insert]=$(( compstate[old_insert] - 1 )) - else - compstate[insert]=$(( compstate[old_insert] + 1 )) - fi - else - return 1 - fi - return 0 -fi - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_options b/zsh_arm64/system/usr/share/zsh/functions/_options deleted file mode 100644 index c6cf30d..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_options +++ /dev/null @@ -1,8 +0,0 @@ -#autoload - -# This should be used to complete all option names. - -local expl - -_wanted zsh-options expl 'zsh option' \ - compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -k - options diff --git a/zsh_arm64/system/usr/share/zsh/functions/_options_set b/zsh_arm64/system/usr/share/zsh/functions/_options_set deleted file mode 100644 index ddb57c3..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_options_set +++ /dev/null @@ -1,10 +0,0 @@ -#autoload - -# Complete all set options. This relies on `_main_complete' to store the -# names of the options that were set when it was called in the array -# `_options_set'. - -local expl - -_wanted zsh-options expl 'set zsh option' \ - compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a - _options_set diff --git a/zsh_arm64/system/usr/share/zsh/functions/_options_unset b/zsh_arm64/system/usr/share/zsh/functions/_options_unset deleted file mode 100644 index 32d58d4..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_options_unset +++ /dev/null @@ -1,10 +0,0 @@ -#autoload - -# Complete all unset options. This relies on `_main_complete' to store the -# names of the options that were unset when it was called in the array -# `_options_unset'. - -local expl - -_wanted zsh-options expl 'unset zsh option' \ - compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a - _options_unset diff --git a/zsh_arm64/system/usr/share/zsh/functions/_parameter b/zsh_arm64/system/usr/share/zsh/functions/_parameter deleted file mode 100644 index 7e77885..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_parameter +++ /dev/null @@ -1,3 +0,0 @@ -#compdef -parameter- - -_parameters -e diff --git a/zsh_arm64/system/usr/share/zsh/functions/_parameters b/zsh_arm64/system/usr/share/zsh/functions/_parameters deleted file mode 100644 index eaad3ca..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_parameters +++ /dev/null @@ -1,39 +0,0 @@ -#autoload - -# This should be used to complete parameter names if you need some of the -# extra options of compadd. It completes only non-local parameters. - -# If you specify a -g option with a pattern, the pattern will be used to -# restrict the type of parameters matched. - -local expl pattern fakes faked tmp pfilt - -if compset -P '*:'; then - _history_modifiers p - return -fi - -pattern=(-g \*) -zparseopts -D -K -E g:=pattern - -fakes=() -faked=() -if zstyle -a ":completion:${curcontext}:" fake-parameters tmp; then - for i in "$tmp[@]"; do - if [[ "$i" = *:* ]]; then - faked=( "$faked[@]" "$i" ) - else - fakes=( "$fakes[@]" "$i" ) - fi - done -fi - -zstyle -t ":completion:${curcontext}:parameters" prefix-needed && \ - [[ $PREFIX != [_.]* ]] && \ - pfilt='[^_.]' - -_wanted parameters expl parameter \ - compadd "$@" -Q - \ - "${(@M)${(@k)parameters[(R)${pattern[2]}~*local*]}:#${~pfilt}*}" \ - "$fakes[@]" \ - "${(@)${(@M)faked:#${~pattern[2]}}%%:*}" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_pick_variant b/zsh_arm64/system/usr/share/zsh/functions/_pick_variant deleted file mode 100644 index 9099e35..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_pick_variant +++ /dev/null @@ -1,41 +0,0 @@ -#autoload - -local output cmd pat -local -a var -local -A opts - -(( $+_cmd_variant )) || typeset -gA _cmd_variant - -zparseopts -D -A opts b: c: r: -: ${opts[-c]:=$words[1]} - -while [[ $1 = *=* ]]; do - var+=( "${1%%\=*}" "${1#*=}" ) - shift -done -if (( $+_cmd_variant[$opts[-c]] )); then - (( $+opts[-r] )) && eval "${opts[-r]}=${_cmd_variant[$opts[-c]]}" - [[ $_cmd_variant[$opts[-c]] = "$1" ]] && return 1 - return 0 -fi - -if [[ $+opts[-b] -eq 1 && -n $builtins[$opts[-c]] ]]; then - _cmd_variant[$opts[-c]]=$opts[-b] - (( $+opts[-r] )) && eval "${opts[-r]}=${_cmd_variant[$opts[-c]]}" - return 0 -fi - -output="$(_call_program variant $opts[-c] "${@[2,-1]}" &1)" - -for cmd pat in "$var[@]"; do - if [[ $output = *$~pat* ]]; then - (( $+opts[-r] )) && eval "${opts[-r]}=$cmd" - _cmd_variant[$opts[-c]]="$cmd" - return 0 - fi -done - -(( $+opts[-r] )) && eval "${opts[-r]}=$1" -_cmd_variant[$opts[-c]]="$1" - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_precommand b/zsh_arm64/system/usr/share/zsh/functions/_precommand deleted file mode 100644 index c9eef78..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_precommand +++ /dev/null @@ -1,9 +0,0 @@ -#compdef - nohup eval time rusage noglob nocorrect catchsegv aoss hilite eatmydata - -# precommands is made local in _main_complete -precommands+=($words[1]) - -shift words -(( CURRENT-- )) - -_normal diff --git a/zsh_arm64/system/usr/share/zsh/functions/_prefix b/zsh_arm64/system/usr/share/zsh/functions/_prefix deleted file mode 100644 index 74be5f4..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_prefix +++ /dev/null @@ -1,67 +0,0 @@ -#autoload - -# Try to ignore the suffix. A bit like e-o-c-prefix. - -[[ _matcher_num -gt 1 || -z "$SUFFIX" ]] && return 1 - -local comp curcontext="$curcontext" tmp suf="$SUFFIX" \ - _completer \ - _matcher _c_matcher _matchers _matcher_num -integer ind - -if ! zstyle -a ":completion:${curcontext}:" completer comp; then - comp=( "${(@)_completers[1,_completer_num-1]}" ) - ind=${comp[(I)_prefix(|:*)]} - (( ind )) && comp=("${(@)comp[ind,-1]}") -fi - -if zstyle -t ":completion:${curcontext}:" add-space; then - ISUFFIX=" $SUFFIX" -else - ISUFFIX="$SUFFIX" -fi -SUFFIX='' - -local _completer_num=1 - -for tmp in "$comp[@]"; do - if [[ "$tmp" = *:-* ]]; then - _completer="${${tmp%:*}[2,-1]//_/-}${tmp#*:}" - tmp="${tmp%:*}" - elif [[ $tmp = *:* ]]; then - _completer="${tmp#*:}" - tmp="${tmp%:*}" - else - _completer="${tmp[2,-1]//_/-}" - fi - curcontext="${curcontext/:[^:]#:/:${_completer}:}" - - zstyle -a ":completion:${curcontext}:" matcher-list _matchers || - _matchers=( '' ) - - _matcher_num=1 - _matcher='' - for _c_matcher in "$_matchers[@]"; do - if [[ "$_c_matcher" == +* ]]; then - _matcher="$_matcher $_c_matcher[2,-1]" - else - _matcher="$_c_matcher" - fi - - if [[ "$tmp" != _prefix ]] && "$tmp"; then - [[ compstate[nmatches] -gt 1 ]] && return 0 - compadd -U -i "$IPREFIX" -I "$ISUFFIX" - "${compstate[unambiguous]%$suf}x" - compstate[list]= - if [[ -n $compstate[unambiguous] ]]; then - compstate[insert]=unambiguous - else - compstate[insert]=0 - fi - return 0 - fi - (( _matcher_num++ )) - done - (( _completer_num++ )) -done - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_print b/zsh_arm64/system/usr/share/zsh/functions/_print deleted file mode 100644 index 0610cd4..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_print +++ /dev/null @@ -1,97 +0,0 @@ -#compdef print printf - -local state expl line eflag pflag rflag rest ret=1 - -if [[ $service = print ]]; then - # -e flag available only after -R - eflag="${words[1,CURRENT-1][(r)-*R*]:+-e[enable escapes]}" - rflag='-r[ignore escape conventions of echo]' - - # -p flag only relevant if we have a coprocess - (:>&p) 2>/dev/null && - pflag='(-s -u -z)-p[print arguments to input of coprocess]' - - [[ -n ${words[(r)-*f]} ]] && rflag='-r[disable reuse of format string]' - - if [[ -n ${words[1,CURRENT][(r)-*P*]} ]]; then - rest='*: :->prompt' - else - rest='*: :_default' - fi - - _arguments -C -s -A "-*" -S \ - '-r[ignore escape conventions of echo]' \ - '(-r -b -f -m -s -S -l -N -o -O -i -c -u -p -z -D -P)-R[emulate BSD echo (no escapes, -n & -e flags only)]' \ - '-b[recognise bindkey escape sequences]' \ - '-m[remove arguments not matching specified pattern]:pattern' \ - '(-n -R -l -N -c -S)-f+[print arguments as for the printf builtin]:format:->printfformat' \ - '(-u -p -z -S)-s[place results in the history list]' \ - '(-a -f -c -C -i -l -o -O -N -u -p -v -z -s -x -X)-S[place results in the history list, after splitting argument into words]' \ - '(-c -f)-n[do not add a newline to the result]' \ - '(-N -c -f -S)-l[print arguments separated by newlines]' \ - '(-n -l -c -f -S)-N[print arguments separated and terminated by nulls]' \ - '(-O -S)-o[sort arguments in ascending order]' \ - '(-o -S)-O[sort arguments in descending order]' \ - '(-S)-i[case-insensitive sorting]' \ - '(-n -l -N -f -s -S -z)-a[with -c/-C, print arguments across before down]' \ - '(-n -l -N -f -C -s -S -z)-c[print arguments in columns]' \ - '(-n -l -N -f -c -s -S -z)-C+[print arguments in specified number of columns]:columns' \ - '(-s -S -p -z)-u+[specify file descriptor to print arguments to]:file descriptor:_file_descriptors' \ - '(-s -S -z -p -u)-v[store output in named parameter]:parameter:_parameters' \ - '(-s -S -p -u)-z[push arguments onto editing buffer stack]' \ - '-D[substitute any arguments which are named directories using ~ notation]' \ - '-P[perform prompt expansion]' \ - '(-X -f -a -C -c -s -S -z)-x+[expand leading tabs]:tab width' \ - '(-x -f -a -C -c -s -S -z)-X+[expand all tabs]:tab width' \ - $pflag $eflag $rflag $rest && ret=0 -elif [[ $service = printf ]]; then - state=printf -fi - -if [[ $state = printf ]]; then - _arguments -C -s -S \ - '-v[store output in named parameter]:parameter:_parameters' \ - '1:format:->printfformat' \ - '*: :_default' && ret=0 -fi - -if [[ $state = printfformat ]]; then - if [[ ${(Q)PREFIX} = *%[0-9\$#\ +*.\'-]# ]]; then - local -a specs - specs=( - '#:alternate form' - '0:zero pad to length' - '-:left adjust result' - ' :leave one space in front of positive number from signed conversion' - '+:always place sign before a number from signed conversion' - '*:field width in next argument' - '.:precision' - "':thousand separators" - 'c:print the first character of the argument' - 's:print the argument as a string' - {d,i}':signed decimal number or with leading " numeric value of following character' - 'o:unsigned octal number' - 'u:unsigned decimal number' - {x,X}':unsigned hexadecimal number, letters capitalized as x' - {e,E}':double number in scientific notation' - 'f:double number' - {g,G}':double number as %f or %e depending on size' - '%:a percent sign' - 'n:store number of printed bytes in parameter specified by argument' - 'b:as %s but interpret escape sequences in argument' - 'q:as %s but shell quote result' - ) - compset -P "*" - _describe -t print-format-specifiers 'print format specifier' specs -S '' - _message -e print-format-specifiers 'number' - else - _wanted print-format-specifiers expl 'print format specifier' compadd -S '' % - fi - ret=0 -elif [[ $state = prompt ]]; then - _default && ret=0 - # complete prompt specifiers without interfering too much with default completion - (( $#compstate[unambiguous] <= $#PREFIX || ! $#PREFIX )) && _ps1234 && ret=0 -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_prompt b/zsh_arm64/system/usr/share/zsh/functions/_prompt deleted file mode 100644 index ef6aac3..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_prompt +++ /dev/null @@ -1,9 +0,0 @@ -#compdef prompt - -_arguments -s \ - '-l[list themes]:*:' \ - '-c[show selected theme]:*:' \ - "-h[help]::prompt theme:($prompt_themes):*:" \ - "-p[preview theme(s)]:*:prompt theme:($prompt_themes)" \ - "-s[set and save theme]:prompt theme:($prompt_themes):*:" \ - ":prompt theme:($prompt_themes)" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_ps1234 b/zsh_arm64/system/usr/share/zsh/functions/_ps1234 deleted file mode 100644 index cf19822..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_ps1234 +++ /dev/null @@ -1,174 +0,0 @@ -#compdef -value-,PROMPT,-default- -value-,PROMPT2,-default- -value-,PROMPT3,-default- -value-,PROMPT4,-default- -value-,RPROMPT,-default- -value-,RPROMPT2,-default- -value-,PS1,-default- -value-,PS2,-default- -value-,PS3,-default- -value-,PS4,-default- -value-,RPS1,-default- -value-,RPS2,-default- -value-,SPROMPT,-default- - -local -a specs ccol -local expl grp cols bs suf pre changed=1 ret=1 -local -A ansi - -[[ -z $compstate[quote] ]] && bs='\' - -# first strip off any complete prompt specifications leaving only the -# current, incomplete, one -while (( changed )); do - changed=0 - compset -P '%[DFK](\\|){[^}]#}' && changed=1 # formats with arg: %x{...} - compset -P '%[0-9-\\]#[^DFK(0-9-<>\\\[]' && changed=1 # normal formats - compset -P '%[0-9-\\]#(<[^<]#<|>[^>]#>|\[[^\]]#\])' && changed=1 # truncations - compset -P '%[0-9-\\]#(\\|)\([0-9-]#[^0-9]?|[^%]' && changed=1 # start of ternary - compset -P '[^%]##' && changed=1 # sundry other characters - # %D/%F/%K without a following { ... } - [[ $PREFIX = %(-|)<->#[DFK](\\[^{]|[^{\\])* ]] && - compset -P '%[0-9\\-]#[DFK]' && changed=1 -done -[[ $PREFIX = %(-|)<->[FK](#e) ]] && compset -P '*' # F/K with number - -if compset -P '%[FK]'; then - # this should use -P but that somehow causes single quotes to be stripped - compset -P '(\\|){' || pre=( -p '{' ) - compset -S '(\\|)}*' || suf=( -S "$bs}" ) - ansi=( - black 30 - red 31 - green 32 - yellow 33 - blue 34 - magenta 35 - cyan 36 - white 37 - default 39 - ) - - _description -V ansi-colors expl 'ansi color' - grp="$expl[expl[(i)-V]+1]" - print -v ccol -f "($grp)=%s=%s" ${(kv)ansi} - _comp_colors+=( $ccol ) - compadd "$expl[@]" $suf $pre -k ansi && ret=0 - if (( $#suf )) && compset -P "(<->|%v)"; then - _wanted ansi-colors expl 'closing brace' compadd -S '' \} && ret=0 - elif (( $+terminfo[colors] )); then - (( cols = $terminfo[colors] - 1 )) - (( cols = cols > 255 ? 255 : cols )) - _description -V terminal-colors expl 'terminal color' - grp="$expl[expl[(i)-V]+1]" - compadd "$expl[@]" $suf $pre {0..$cols} - for c in {0..$cols}; do - _comp_colors+=( "($grp)=${c}=${${$(print -P "%F{$c}")#?\[}%m}" ) - done - else - _message -e terminal-colors "number" - fi -fi - -if compset -P '%[0-9-\\]#(\\|)\([0-9-]#[^0-9]'; then - # ternary conditional: first delimiter - compset -S '*' - _delimiters && ret=0 -elif compset -P '%[0-9-\\]#[<>\]]'; then - # truncation - _message -e replacements 'replacement string' -elif compset -P '%[0-9-\\]#(\\|)\([0-9-]#'; then - # ternary conditional: condition character - compset -S '[.:+/-%]*' || suf=( -S . ) - compset -S '*' - specs=( - '!:running with privileges' - '#:effective uid' - '?:exit status' - '_:at least n shell constructs started' - 'C:at least n path elements' - '/:at least n path elements' - '.:at least n path elements' - 'c:at least n path elements' - '~:at least n path elements' - 'D:month' - 'd:day of month' - 'g:effective gid' - 'j:number of jobs' - 'L:SHLVL' - 'l:number of characters already printed' - 'S:SECONDS parameter at least n' - 'T:current hour' - 't:current minute' - 'v:psvar has at least n elements' - 'V:element n of psvar is set and non-empty' - 'w:day of week (Sunday = 0)' - ) - [[ $IPREFIX != *- ]] && _describe -t ternary-prompt-expressions \ - 'ternary prompt format test character' specs $suf && ret=0 - _message -e numbers number -elif compset -P '%D(\\|){'; then - compset -S '(\\|)}*' - _date_formats zsh && ret=0 -elif [[ -prefix '%' ]] || - ! zstyle -t ":completion:${curcontext}:prompt-format-specifiers" prefix-needed -then - specs=( - 'm:hostname up to first .' - '_:status of parser' - '^:reversed status of parser' - 'd:current working directory' - '/:current working directory' - '~:current working directory, with ~ replacement' - 'N:name of current script or shell function' - 'x:name of file containing code being executed' - 'c:deprecated' - '.:deprecated' - 'C:deprecated' - 'F:start using fg color' - 'K:start using bg color' - 'G:counts as extra character inside %{...%}' - '(:ternary expression %(x.true-string.false-string)' - ) - compset -P '%' || pre=( -p '%' ) - if ! compset -P '(-|)<->'; then - if [[ $service == -value-,SPROMPT,* ]]; then - specs+=( - 'r:suggested correction' - 'R:corrected string' - ) - fi - specs+=( - '%:A %' - '):A )' - 'l:current line (tty) with /dev/tty stripped' - 'M:full hostname' - 'n:username' - 'y:current line (tty)' - '#:a # when root, % otherwise' - '?:return status of last command' - 'h:current history event number' - '!:current history event number' - 'i:current line number' - 'I:current source line number' - 'j:number of jobs' - 'L:$SHLVL' - 'D:date in yy-mm-dd format' - 'T:current time of day, 24-hour format' - 't:current time of day, 12-hour am/pm format' - '@:current time of day, 12-hour am/pm format' - '*:current time of day, 24-hour format with seconds' - 'w:the date in day-dd format' - 'W:the date in mm/dd/yy format' - 'D{:format string like strftime' - 'B:start bold' - 'b:stop bold' - 'E:clear to end of line' - 'U:start underline' - 'u:stop underline' - 'S:start standout' - 's:stop standout' - 'f:reset fg color' - 'k:reset bg color' - '{:start literal escape sequence' - '}:stop literal escape sequence' - 'v:value from $psvar array' - '<:truncation from left %len:truncation from right %len>string>' - '[:truncation from who knows where' - ) - fi - _describe -t prompt-format-specifiers 'prompt format specifier' \ - specs -S '' $pre && ret=0 - (( ! $#pre )) && _message -e prompt-format-specifiers number -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_read b/zsh_arm64/system/usr/share/zsh/functions/_read deleted file mode 100644 index 1f733b0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_read +++ /dev/null @@ -1,21 +0,0 @@ -#compdef read - -local pflag - -# -p flag only relevant if we have a coprocess -(:>&p) 2>/dev/null && - pflag='(-q -s -u -z)-p[input is read from the coprocess]' - -_arguments -s -A "-*" -S \ - '-r[raw mode]' \ - '(-p -k -s -u -z)-q[read y or n character from terminal]' \ - '(-q)-k+[specify number of characters to read]:: :_guard "[0-9]#" "number of characters"' \ - '(-q -z)-t+[test if input is available before reading]:: :_guard "[0-9.]#" "timeout (seconds)"' \ - '(-q)-d[specify delimiter to terminate input instead of newline]:delimiter' \ - '(-q -s -u -p -t)-z[read entry from editor buffer stack]' \ - '(-E)-e[input read is echoed and not assigned]' \ - '(-e)-E[input read is echoed]' \ - '(-q -z -p)-s[suppress terminal echoing]' \ - '-A[first name is taken as an array]' \ - '(-q -z -p)-u+[specify file descriptor to read from]:file descriptor:_file_descriptors' \ - $pflag '1:varprompt:_vars -qS\?' '*:vars:_vars' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_read_comp b/zsh_arm64/system/usr/share/zsh/functions/_read_comp deleted file mode 100644 index 3dd7f9a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_read_comp +++ /dev/null @@ -1,152 +0,0 @@ -#compdef -k complete-word \C-x\C-r - -# This allows an on-the-fly choice of completions. On typing the key -# sequence given above, you will be prompted for a string of arguments. If -# this string begins with `_', it will be taken as the name of a function to -# evaluate to generate the completions; unambiguous strings in the function -# name are automatically completed. -# -# Else it is taken to be a set of arguments for compadd to generate a list -# of choices. The possibilities are the same as the flags for generating -# completions given in the zshcompwid manual page. Note the arguments are -# verbatim: include minus signs, spaces, quotes, etc. -# -# On subsequent calls, the same completion will be re-performed. To -# force a new type of completion to be read, supply a numeric argument. -# -# For example, -# % bindkey | grep rever -# Completion: -b -# % bindkey | grep reverse-menu-complete _ -# -# Global variables used: -# _read_comp Last completion string read from user - -# emulate -L zsh -setopt localoptions extendedglob nobadpattern unset # xtrace promptsubst -# local PS4='%N:%i:$((#key))> ' - -typeset -g _read_comp -if [[ ${+NUMERIC} = 0 && -n $_read_comp ]]; then - if [[ $_read_comp = _* ]]; then - eval $_read_comp - else - eval "compadd $_read_comp" - fi - return -fi - -_read_comp= - -local key search str str2 newch funcs funcs2 exact msg list -integer pos - -msg="Completion: " - -zle -R $msg - -if ! read -k key; then - zle -cR '' - return 1 -fi - -while [[ '#key' -ne 10 && '#key' -ne 13 ]]; do - if [[ '#key' -eq 0 && '#key' -eq 3 || '#key' -eq 7 ]]; then - zle -cR '' - return 1 - fi - if [[ ( '#key' -eq 8 || '#key' -eq 127 ) && -n $str ]]; then - # delete character - str="$str[1,-2]" - exact= - list=() - elif [[ '#key' -eq 21 ]]; then - # ^U: delete line - str= - exact= - list=() - elif [[ '#key' -eq 4 && $str = _[^\ ]# && $str != *' '* ]]; then - # ^D: list completions - list=(${$(whence -m "$str*" 2>/dev/null)%: function}) - elif [[ ( -n $exact && $key != ' ' ) || '#key & 127' -lt 32 ]]; then - # If we've got an exact function, only allow a space after it. - # Don't try to insert non-printing characters. - if [[ -n $ZBEEP ]]; then - print -nb $ZBEEP - elif [[ -o beep ]]; then - print -n "\a" - fi - list=() - else - str="$str$key" - if [[ $str = _[^\ ]# ]]; then - # Rudimentary completion for function names. - # Allow arguments, i.e. don't do this after we've got a space. - funcs=(${$(whence -m "$str*" 2>/dev/null)%: function}) - if [[ -o autolist && $#str -gt 1 ]]; then - list=($funcs) - else - list=() - fi - if (( $#funcs == 1 )); then - # Exact match; prompt the user for a newline to confirm - str=$funcs[1] - exact=" (Confirm)" - elif (( $#funcs == 0 )); then - # We can't call zle beep, because this isn't a zle widget. - if [[ -n $ZBEEP ]]; then - print -nb $ZBEEP - elif [[ -o beep ]]; then - print -n "\a" - fi - str="$str[1,-2]" - list=() - else - # Add characters to the string until a name doesn't - # match any more, then backtrack one character to get - # the longest unambiguous match. - str2=$str - pos=$#str2 - while true; do - (( pos++ )) - newch=${funcs[1][pos]} - [[ -z $newch ]] && break - str2=$str2$newch - funcs2=(${funcs##$str2*}) - (( $#funcs2 )) && break - str=$str2 - done - fi - else - exact= - fi - fi - if (( $#list )); then - zle -R "$msg$str$exact" $list - else - zle -cR "$msg$str$exact" - fi - if ! read -k key; then - zle -cR '' - return 1 - fi -done - -if [[ -z $str ]]; then - # string must be non-zero - return 1 -elif [[ $str = _* ]] && ! whence ${str%% *} >& /dev/null; then - # a function must be known to the shell - return 1 -else - # remember the string for re-use - _read_comp=$str -fi - -zle -cR '' - -if [[ $str = _* ]]; then - eval $str -else - eval "compadd $str" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_redirect b/zsh_arm64/system/usr/share/zsh/functions/_redirect deleted file mode 100644 index e6da5d1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_redirect +++ /dev/null @@ -1,18 +0,0 @@ -#compdef -redirect- - -local strs _comp_command1 _comp_command2 _comp_command - -_set_command - -strs=( -default- ) - -if [[ "$CURRENT" != "1" ]]; then - strs=( "${_comp_command}" "$strs[@]" ) - if [[ -n "$_comp_command1" ]]; then - strs=( "${_comp_command1}" "$strs[@]" ) - [[ -n "$_comp_command2" ]] && - strs=( "${_comp_command2}" "$strs[@]" ) - fi -fi - -_dispatch -redirect-,{${compstate[redirect]},-default-},${^strs} diff --git a/zsh_arm64/system/usr/share/zsh/functions/_regex_arguments b/zsh_arm64/system/usr/share/zsh/functions/_regex_arguments deleted file mode 100644 index 2e8fee8..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_regex_arguments +++ /dev/null @@ -1,86 +0,0 @@ -#autoload - -## usage: _regex_arguments funcname regex - -# _regex_arguments compiles `regex' and emits the result of the state -# machine into the function `funcname'. `funcname' parses a command line -# according to `regex' and evaluates appropriate actions in `regex'. Before -# parsing the command line string is generated by concatenating `words' -# (before `PREFIX') and `PREFIX' with a separator NUL ($'\0'). - -# The `regex' is defined as follows. - -## regex word definition: - -# pattern = "/" ( glob | "[]" ) "/" [ "+" | "-" ] -# lookahead = "%" glob "%" -# guard = "-" zsh-code-to-eval -# caction = ":" tag ":" descr ":" zsh-code-to-eval -# action = "{" zsh-code-to-eval "}" - -## regex word sequence definition: - -# element = pattern [ lookahead ] [ guard ] [ caction ] -# -# regex = element -# | "(" regex ")" -# | regex "#" -# | ( regex | action ) # -# | regex "|" regex - -# example: - -# compdef _tst tst - -# _regex_arguments _tst /$'[^\0]#\0'/ /$'[^\0]#\0'/ :'compadd aaa' -# _tst complete `aaa' for first argument. -# First $'[^\0]#\0' is required to match with command name. - -# _regex_arguments _tst /$'[^\0]#\0'/ \( /$'[^\0]#\0'/ :'compadd aaa' /$'[^\0]#\0'/ :'compadd bbb' \) \# -# _tst complete `aaa' for (2i+1)th argument and `bbb' for (2i)th argument. - -# _regex_arguments _tst /$'[^\0]#\0'/ \( /$'[^\0]#\0'/ :'compadd aaa' \| /$'[^\0]#\0'/ :'compadd bbb' \) \# -# _tst complete `aaa' or `bbb'. - -## Recursive decent regex parser - -# return status of parser functions: - -# 0 : success -# 1 : parse error -# 2 : fatal parse error - -_ra_comp () { - _ra_actions=("$_ra_actions[@]" "$1") -} - -_regex_arguments () { - local regex funcname="$1" - shift - regex=(${@:/(#b):(*)/":_ra_comp ${(qqqq)match[1]}"}) - - eval \ - "$funcname"' () { - local _ra_p1 _ra_p2 _ra_left _ra_right _ra_com expl tmp nm="$compstate[nmatches]" - local _ra_actions _ra_line="${(pj:\0:)${(@)words[1,CURRENT - 1]:Q}}"$'\''\0'\''"$PREFIX" - _ra_actions=() - zregexparse -c _ra_p1 _ra_p2 "$_ra_line" '"${(j: :)${(qqqq)regex[@]}}"' - case "$?" in - 0|2) _message "no more arguments";; - 1) - if [[ "$_ra_line[_ra_p1 + 1, -1]" = *$'\''\0'\''* ]]; then - _message "parse failed before current word" - else - _ra_left="$_ra_line[_ra_p1 + 1, _ra_p2]" - _ra_right="$_ra_line[_ra_p2 + 1, -1]" - compset -p $(( $#PREFIX - $#_ra_line + $_ra_p1 )) - (( $#_ra_actions )) && _alternative "$_ra_actions[@]" - fi - ;; - 3) _message "invalid regex";; - esac - [[ nm -ne "$compstate[nmatches]" ]] - }' -} - -_regex_arguments "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_regex_words b/zsh_arm64/system/usr/share/zsh/functions/_regex_words deleted file mode 100644 index 90b4a97..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_regex_words +++ /dev/null @@ -1,52 +0,0 @@ -#autoload - -local opt OPTARG matches end -local term=$'\0' - -while getopts "t:" opt; do - case $opt in - (t) - term=$OPTARG - ;; - - (*) - return 1 - ;; - esac -done -shift $(( OPTIND - 1 )) - -local tag=$1 -local desc=$2 -shift 2 - -if (( $# )); then - reply=(\() -else - # ### Is this likely to happen in callers? Should we warn? - reply=() - return -fi - -integer i -local -a wds - -if [[ $term = $'\0' ]]; then - matches=":${tag}:${desc}:(( " - end="))" -else - matches=":${tag}:${desc}:_values -s ${(q)term} ${(q)desc}" -fi - -for (( i = 1; i <= $#; i++ )); do - wds=(${(s.:.)argv[i]}) - reply+=(/${wds[1]//\**/"[^$term]#"}"$term"/) - if [[ $term = $'\0' ]]; then - matches+="${wds[1]//\*}${wds[2]:+\\:${wds[2]//(#m)[: \(\)]/\\$MATCH}} " - else - matches+=" ${(q)${${wds[1]//\*}//(#m)[:\[\]]/\\$MATCH}}\\[${(q)${wds[2]//(#m)[:\[\]]/\\$MATCH}}\\]" - fi - eval "reply+=($wds[3])" - reply+=(\|) -done -reply+=( /'[]'/ "${matches}${end}" \) ) diff --git a/zsh_arm64/system/usr/share/zsh/functions/_requested b/zsh_arm64/system/usr/share/zsh/functions/_requested deleted file mode 100644 index 4ba52ce..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_requested +++ /dev/null @@ -1,17 +0,0 @@ -#autoload - -local __gopt - -__gopt=() -zparseopts -D -a __gopt 1 2 V J x - -if comptags -R "$1"; then - if [[ $# -gt 3 ]]; then - _all_labels - "$__gopt[@]" "$@" || return 1 - elif [[ $# -gt 1 ]]; then - _description "$__gopt[@]" "$@" - fi - return 0 -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_retrieve_cache b/zsh_arm64/system/usr/share/zsh/functions/_retrieve_cache deleted file mode 100644 index 43cdd79..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_retrieve_cache +++ /dev/null @@ -1,31 +0,0 @@ -#autoload -# -# Retrieval component of completions caching layer - -local _cache_ident _cache_dir _cache_path _cache_policy -_cache_ident="$1" - -if zstyle -t ":completion:${curcontext}:" use-cache; then - # Decide which directory to retrieve cache from, and ensure it exists - zstyle -s ":completion:${curcontext}:" cache-path _cache_dir - : ${_cache_dir:=${ZDOTDIR:-$HOME}/.zcompcache} - if [[ ! -d "$_cache_dir" ]]; then - [[ -e "$_cache_dir" ]] && - _message "cache-dir ($_cache_dir) isn't a directory\!" - return 1 - fi - - _cache_path="$_cache_dir/$_cache_ident" - - if [[ -e "$_cache_path" ]]; then - _cache_invalid "$_cache_ident" && return 1 - - . "$_cache_path" - return 0 - else - return 1 - fi -else - return 1 -fi - diff --git a/zsh_arm64/system/usr/share/zsh/functions/_run-help b/zsh_arm64/system/usr/share/zsh/functions/_run-help deleted file mode 100644 index 9a3266c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_run-help +++ /dev/null @@ -1,7 +0,0 @@ -#compdef run-help -local d expl -local HELPDIR=${HELPDIR:-} -[[ -d $HELPDIR ]] && { - d=($HELPDIR/*(:t)) - (($#d)) && d+=('.' ':') && _wanted commands expl 'command' compadd -a d -} || _man diff --git a/zsh_arm64/system/usr/share/zsh/functions/_sched b/zsh_arm64/system/usr/share/zsh/functions/_sched deleted file mode 100644 index e8ff5ab..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_sched +++ /dev/null @@ -1,21 +0,0 @@ -#compdef sched - -local expl lines disp - -if [[ CURRENT -eq 2 ]]; then - if compset -P -; then - lines=(${(f)"$(sched)"}) - if zstyle -T ":completion:${curcontext}:jobs" verbose; then - disp=( -ld lines ) - else - disp=() - fi - [[ -z $lines ]] || _wanted jobs expl 'scheduled jobs' \ - compadd "$disp[@]" - {1..$#lines} - return - else - _message -e times 'time specification' - return 1 - fi -fi -compset -n 3 && _normal diff --git a/zsh_arm64/system/usr/share/zsh/functions/_sep_parts b/zsh_arm64/system/usr/share/zsh/functions/_sep_parts deleted file mode 100644 index de836a6..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_sep_parts +++ /dev/null @@ -1,146 +0,0 @@ -#autoload - -# This function can be used to separately complete parts of strings -# where each part may be one of a set of matches and different parts -# have different sets. -# Arguments are alternately arrays and separator strings. Arrays may -# be given by name or literally as words separated by white space in -# parentheses, e.g.: -# -# _sep_parts '(foo bar)' @ hosts -# -# This will make this function complete the strings `foo' and `bar'. -# If the string on the line contains a `@', the substring after it -# will be completed from the array `hosts'. Of course more arrays -# may be given, each preceded by another separator string. -# -# This function understands the `-J group', `-V group', and -# `-X explanation' options. - -local str arr sep test testarr tmparr prefix suffixes autosuffix -local matchflags opt group expl nm=$compstate[nmatches] opre osuf opts matcher - -# Get the options. - -zparseopts -D -a opts \ - 'J+:=group' 'V+:=group' P: F: S: r: R: q 1 2 n 'X+:=expl' 'M+:=matcher' - -# Get the string from the line. - -opre="$PREFIX" -osuf="$SUFFIX" -str="$PREFIX$SUFFIX" -SUFFIX="" -prefix="" - -# Walk through the arguments to find the longest unambiguous prefix. - -while [[ $# -gt 1 ]]; do - # Get the next array and separator. - arr="$1" - sep="$2" - - if [[ "$arr[1]" == '(' ]]; then - tmparr=( ${=arr[2,-2]} ) - arr=tmparr - fi - - # Is the separator on the line? - - [[ "$str" != *${sep}* ]] && break - - # Get the matching array elements. - - PREFIX="${str%%(|\\)${sep}*}" - builtin compadd -O testarr "$matcher[@]" -a "$arr" - [[ $#testarr -eq 0 && -n "$_comp_correct" ]] && - compadd -O testarr "$matcher[@]" -a "$arr" - - # If there are no matches we give up. If there is more than one - # match, this is the part we will complete. - - (( $#testarr )) || return 1 - [[ $#testarr -gt 1 ]] && break - - # Only one match, add it to the prefix and skip over it in `str', - # continuing with the next array and separator. - - prefix="${prefix}${testarr[1]}${sep}" - str="${str#*${sep}}" - shift 2 -done - -# Get the array to work upon. - -arr="$1" -if [[ "$arr[1]" == '(' ]]; then - tmparr=( ${=arr[2,-2]} ) - arr=tmparr -fi - -if [[ $# -le 1 || "$str" != *${2}* ]]; then - # No more separators, build the matches. - - PREFIX="$str" - builtin compadd -O testarr "$matcher[@]" -a "$arr" - [[ $#testarr -eq 0 && -n "$_comp_correct" ]] && - compadd -O testarr "$matcher[@]" -a "$arr" -fi - -[[ $#testarr -eq 0 || ${#testarr[1]} -eq 0 ]] && return 1 - -# Now we build the suffixes to give to the completion code. - -shift -suffixes=("") -autosuffix=() - -while [[ $# -gt 0 && "$str" == *${1}* ]]; do - # Remove anything up to the suffix. - - str="${str#*${1}}" - - # Again, we get the string from the line up to the next separator - # and build a pattern from it. - - if [[ $# -gt 2 ]]; then - PREFIX="${str%%${3}*}" - else - PREFIX="$str" - fi - - # We incrementally add suffixes by appending to them the separators - # and the strings from the next array that match the pattern we built. - - arr="$2" - if [[ "$arr[1]" == '(' ]]; then - tmparr=( ${=arr[2,-2]} ) - arr=tmparr - fi - - builtin compadd -O tmparr "$matcher[@]" -a "$arr" - [[ $#tmparr -eq 0 && -n "$_comp_correct" ]] && - compadd -O tmparr "$matcher[@]" - "$arr" - - suffixes=("${(@)^suffixes[@]}${(q)1}${(@)^tmparr}") - - shift 2 -done - -# If we were given at least one more separator we make the completion -# code offer it by appending it as a autoremovable suffix. - -(( $# )) && autosuffix=(-qS "${(q)1}") - -# Add the matches for each of the suffixes. - -PREFIX="$pre" -SUFFIX="$suf" -for i in "$suffixes[@]"; do - compadd -U "$group[@]" "$expl[@]" "$autosuffix[@]" "$opts[@]" \ - -i "$IPREFIX" -I "$ISUFFIX" -p "$prefix" -s "$i" -a testarr -done - -# This sets the return value to indicate that we added matches (or not). - -[[ nm -ne compstate[nmatches] ]] diff --git a/zsh_arm64/system/usr/share/zsh/functions/_sequence b/zsh_arm64/system/usr/share/zsh/functions/_sequence deleted file mode 100644 index f52955f..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_sequence +++ /dev/null @@ -1,39 +0,0 @@ -#autoload - -# a separated list where each component of the list uses the same -# function. - -# -n num : number of items in list [default is unlimited] -# -s sep : specify separator [defaults to comma] -# -d : duplicate values allowed - -local curcontext="$curcontext" nm="$compstate[nmatches]" pre qsep nosep minus -local -a sep num pref suf end uniq dedup - -zparseopts -D -a opts s:=sep n:=num p:=pref i:=pref P:=pref I:=suf S:=suf q=suf r:=suf R:=suf C:=cont d=uniq M: J: X: x: -(( $#cont )) && curcontext="${curcontext%:*}:$cont[2]" -(( $#sep )) || sep[2]=, - -if (( $+suf[(r)-S] )); then - end="${(q)suf[suf[(i)-S]+1]}" - (( $#end )) && compset -S ${end}\* && suf=() && nosep=1 -fi - -qsep="${sep[2]}" -compquote -p qsep -if (( ! $#uniq )); then - (( $+pref[(r)-P] )) && pre="${(q)pref[pref[(i)-P]+1]}" - dedup=( "${(@)${(@ps.$qsep.)PREFIX#$pre}[1,-2]}" "${(@)${(@ps.$qsep.)SUFFIX}[2,-1]}" ) - [[ -n $compstate[quoting] ]] || dedup=( ${(Q)dedup} ) -fi - -if (( $#num )) && compset -P $(( num[2] - 1 )) \*${(q)qsep}; then - pref=() -else - (( ! nosep && (!$#num || num[2] > 1) )) && suf=( -S ${qsep} -r "$end[1]${(q)qsep[1]} \t\n\-" ) - compset -S ${(q)qsep}\* && suf=() - compset -P \*${(q)qsep} && pref=() -fi - -(( minus = argv[(ib:2:)-] )) -"${(@)argv[1,minus-1]}" "$opts[@]" -F dedup "$pref[@]" "$suf[@]" "${(@)argv[minus+1,-1]}" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_set b/zsh_arm64/system/usr/share/zsh/functions/_set deleted file mode 100644 index 27c7f3c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_set +++ /dev/null @@ -1,25 +0,0 @@ -#compdef set - -noglob _arguments -s -S \ - - list '+[list names of parameters]' - others \ - '-o+[set specified option]:option:_options' \ - '+o+[unset specified option]:option:_options' \ - '-s[sort arguments in descending order]' \ - '+s[sort arguments in ascending order]' \ - '-A+[define array with specified name]:array:_arrays' \ - '+A+[replace initial elements in specified array]:array:_arrays' \ - {-,+}0[correct] {-,+}1[printexitvalue] {-,+}2[no-badpattern] \ - {-,+}3[no-nomatch] {-,+}4[globdots] {-,+}5[notify] {-,+}6[bgnice] \ - {-,+}7[ignoreeof] {-,+}8[markdirs] {-,+}9[autolist] {-,+}B[no-beep] \ - {-,+}C[no-clobber] {-,+}D[pushdtohome] {-,+}E[pushdsilent] {-,+}F[no-glob] \ - {-,+}G[nullglob] {-,+}H[rmstarsilent] {-,+}I[ignorebraces] {-,+}J[autocd] \ - {-,+}K[no-banghist] {-,+}L[sunkeyboardhack] {-,+}M[singlelinezle] \ - {-,+}N[autopushd] {-,+}O[correctall] {-,+}P[rcexpandparam] {-,+}Q[pathdirs] \ - {-,+}R[longlistjobs] {-,+}S[recexact] {-,+}T[cdablevars] \ - {-,+}U[mailwarning] {-,+}V[no-promptcr] {-,+}W[autoresume] \ - {-,+}X[listtypes] {-,+}Y[menucomplete] {-,+}Z[zle] {-,+}a[allexport] \ - {-,+}d[no-globalrcs] {-,+}e[errexit] {-,+}f[no-rcs] {-,+}g[histignorespace] \ - {-,+}h[histignoredups] {-,+}i[interactive] {-,+}k[interactivecomments] \ - {-,+}l[login] {-,+}m[monitor] {-,+}n[no-exec] {-,+}p[privileged] \ - {-,+}r[restricted] {-,+}t[singlecommand] {-,+}u[no-unset] {-,+}v[verbose] \ - {-,+}w[chaselinks] {-,+}x[xtrace] {-,+}y[shwordsplit] diff --git a/zsh_arm64/system/usr/share/zsh/functions/_set_command b/zsh_arm64/system/usr/share/zsh/functions/_set_command deleted file mode 100644 index 6b49108..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_set_command +++ /dev/null @@ -1,31 +0,0 @@ -#autoload - -# This sets the parameters _comp_command1, _comp_command2 and _comp_command -# in the calling function. - -local command - -command="$words[1]" - -[[ -z "$command" ]] && return - -if (( $+builtins[$command] + $+functions[$command] )); then - _comp_command1="$command" - _comp_command="$_comp_command1" -elif [[ "$command[1]" = '=' ]]; then - eval _comp_command2\=$command - _comp_command1="$command[2,-1]" - _comp_command="$_comp_command2" -elif [[ "$command" = ..#/* ]]; then - _comp_command1="${PWD}/$command" - _comp_command2="${command:t}" - _comp_command="$_comp_command2" -elif [[ "$command" = */* ]]; then - _comp_command1="$command" - _comp_command2="${command:t}" - _comp_command="$_comp_command2" -else - _comp_command1="$command" - _comp_command2="$commands[$command]" - _comp_command="$_comp_command1" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_setopt b/zsh_arm64/system/usr/share/zsh/functions/_setopt deleted file mode 100644 index 86c0965..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_setopt +++ /dev/null @@ -1,17 +0,0 @@ -#compdef setopt unsetopt - -local expl ret=1 -local -a onopts offopts -onopts=( ${(k)_comp_caller_options[(R)on]} printexitvalue ) -offopts=( ${(k)_comp_caller_options[(R)off]} printexitvalue ) -typeset -U onopts offopts -case $service in - setopt) onopts=(no$onopts) ;; - unsetopt) offopts=(no$offopts) ;; -esac -_wanted zsh-options expl 'zsh options (set)' \ - compadd -J 'enabled options' -M 'M:_= M:{A-Z}={a-z}' -k - onopts && ret=0 -_wanted zsh-options expl 'zsh options (unset)' \ - compadd -J 'disabled options' -M 'M:_= M:{A-Z}={a-z}' -k - offopts && ret=0 - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_setup b/zsh_arm64/system/usr/share/zsh/functions/_setup deleted file mode 100644 index ca97533..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_setup +++ /dev/null @@ -1,79 +0,0 @@ -#autoload - -local val nm="$compstate[nmatches]" - -[[ $# -eq 1 ]] && 2="$1" - -if zstyle -a ":completion:${curcontext}:$1" list-colors val; then - zmodload -i zsh/complist - if [[ "$1" = default ]]; then - _comp_colors=( "$val[@]" ) - else - _comp_colors+=( "(${2})${(@)^val:#(|\(*\)*)}" "${(M@)val:#\(*\)*}" ) - fi - -# Here is the problem mentioned in _main_complete. - -# elif [[ "$1" = default && -n "$ZLS_COLORS$ZLS_COLOURS" ]]; then -# zmodload -i zsh/complist -# ZLS_COLORS="$ZLS_COLORS$ZLS_COLOURS" - -elif [[ "$1" = default ]]; then - unset ZLS_COLORS ZLS_COLOURS -fi - -# What we'd like is to test that the show-ambiguity style pattern is more -# specific than the list-colors style pattern, but that's not possible yet -if zstyle -s ":completion:${curcontext}:$1" show-ambiguity val; then - zmodload -i zsh/complist - [[ $val = (yes|true|on) ]] && _ambiguous_color=4 || _ambiguous_color=$val -fi - -if zstyle -t ":completion:${curcontext}:$1" list-packed; then - compstate[list]="${compstate[list]} packed" -elif [[ $? -eq 1 ]]; then - compstate[list]="${compstate[list]:gs/packed//}" -else - compstate[list]="$_saved_list" -fi - -if zstyle -t ":completion:${curcontext}:$1" list-rows-first; then - compstate[list]="${compstate[list]} rows" -elif [[ $? -eq 1 ]]; then - compstate[list]="${compstate[list]:gs/rows//}" -else - compstate[list]="$_saved_list" -fi - -if zstyle -t ":completion:${curcontext}:$1" last-prompt; then - compstate[last_prompt]=yes -elif [[ $? -eq 1 ]]; then - compstate[last_prompt]='' -else - compstate[last_prompt]="$_saved_lastprompt" -fi - -if zstyle -t ":completion:${curcontext}:$1" accept-exact; then - compstate[exact]=accept -elif [[ $? -eq 1 ]]; then - compstate[exact]='' -else - compstate[exact]="$_saved_exact" -fi - -[[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] && - _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) - -if zstyle -a ":completion:${curcontext}:$1" menu val; then - _last_nmatches=$nm - _last_menu_style=( "$val[@]" ) -else - _last_nmatches=-1 -fi - -[[ "$_comp_force_list" != always ]] && - zstyle -s ":completion:${curcontext}:$1" force-list val && - [[ "$val" = always || - ( "$val" = [0-9]## && - ( -z "$_comp_force_list" || _comp_force_list -gt val ) ) ]] && - _comp_force_list="$val" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_source b/zsh_arm64/system/usr/share/zsh/functions/_source deleted file mode 100644 index 96b6c21..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_source +++ /dev/null @@ -1,14 +0,0 @@ -#compdef source . - -if [[ CURRENT -ge 3 ]]; then - compset -n 2 - _normal -else - if [[ -prefix */ && ! -o pathdirs ]]; then - _files - elif [[ $service = . ]]; then - _files -W path - else - _files -W "(. $path)" - fi -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_store_cache b/zsh_arm64/system/usr/share/zsh/functions/_store_cache deleted file mode 100644 index fb2ab32..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_store_cache +++ /dev/null @@ -1,64 +0,0 @@ -#autoload -# -# Storage component of completions caching layer - -local _cache_ident _cache_ident_dir -_cache_ident="$1" - -if zstyle -t ":completion:${curcontext}:" use-cache; then - # Decide which directory to cache to, and ensure it exists - zstyle -s ":completion:${curcontext}:" cache-path _cache_dir - : ${_cache_dir:=${ZDOTDIR:-$HOME}/.zcompcache} - if [[ ! -d "$_cache_dir" ]]; then - if [[ -e "$_cache_dir" ]]; then - _message "cache-dir style points to a non-directory\!" - else - # if module load fails, we *should* be okay using normal mkdir so - # we load feature b:mkdir instead of b:zf_mkdir; note that modules - # loaded in a sub-shell don't affect the parent. - ( zmodload -F zsh/files b:mkdir; mkdir -m 0700 -p "$_cache_dir" - ) 2>/dev/null - if [[ ! -d "$_cache_dir" ]]; then - _message "couldn't create cache-dir $_cache_dir" - return 1 - fi - fi - fi - _cache_ident_dir="$_cache_dir/$_cache_ident" - _cache_ident_dir="$_cache_ident_dir:h" - - if [[ ! -d "$_cache_ident_dir" ]]; then - if [[ -e "$_cache_ident_dir" ]]; then - _message "cache ident dir points to a non-directory:$_cache_ident_dir" - else - # See also rationale in zmodload above - ( zmodload -F zsh/files b:mkdir; mkdir -m 0700 -p "$_cache_ident_dir" - ) 2>/dev/null - if [[ ! -d "$_cache_ident_dir" ]]; then - _message "couldn't create cache-ident_dir $_cache_ident_dir" - return 1 - fi - fi - fi - - - shift - for var; do - case ${(Pt)var} in - (*readonly*) ;; - (*(association|array)*) - # Dump the array as a here-document to reduce parsing overhead - # when reloading the cache with "source" from _retrieve_cache - print -r "$var=( "'${(Q)"${(z)$(<<\EO:'"$var" - print -r "${(kv@Pqq)^^var}" - print -r "EO:$var" - print -r ')}"} )' - ;; - (*) print -r "$var=${(Pqq)^^var}";; - esac - done >! "$_cache_dir/$_cache_ident" -else - return 1 -fi - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_strftime b/zsh_arm64/system/usr/share/zsh/functions/_strftime deleted file mode 100644 index 0849f1c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_strftime +++ /dev/null @@ -1,14 +0,0 @@ -#compdef strftime - -local ret=1 expl - -_arguments -S -A '-*' -s \ - '-q[run quietly]' \ - '(3)-r[reverse lookup using strptime]' \ - '-s+[assign result to parameter]:param:_parameters' \ - '1:format: _date_formats zsh' \ - '2:epoch time (or date string with -r)' \ - '3:nanoseconds' \ -&& ret=0 - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_sub_commands b/zsh_arm64/system/usr/share/zsh/functions/_sub_commands deleted file mode 100644 index 429931a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_sub_commands +++ /dev/null @@ -1,9 +0,0 @@ -#autoload - -local expl - -if [[ CURRENT -eq 2 ]]; then - _wanted commands expl command compadd "$@" -else - _message 'no more arguments' -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_subscript b/zsh_arm64/system/usr/share/zsh/functions/_subscript deleted file mode 100644 index 0c9a89a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_subscript +++ /dev/null @@ -1,131 +0,0 @@ -#compdef -subscript- - -local expl ind osuf=']' flags sep - -if [[ "$1" = -q ]]; then - compquote osuf - osuf+=' ' - shift -fi - -compset -P '\(([^\(\)]|\(*\))##\)' # remove subscript flags - -# Look for a dynamic name expansion. Completion only gives us -# the stuff inside the square brackets; we need to find out what's -# outside. We ought to check for quoting, really, but given we've -# got to the subscript code " ~[" is pretty likely to be a dynamic -# name expansion. Also expand in anything that looks like an assignment -# or colon list. -integer pos=$((CURSOR+1)) -while [[ pos -gt 1 && $BUFFER[pos-1] != '[' ]]; do (( pos-- )); done -if [[ $BUFFER[1,pos-1] = (|*[[:space:]:=]##)\~\[ ]]; then - _dynamic_directory_name -elif [[ "$PREFIX" = :* ]]; then - _wanted characters expl 'character class' \ - compadd -p: -S ':]' alnum alpha ascii blank cntrl digit graph \ - lower print punct space upper xdigit IFS IDENT IFSSPACE WORD -elif compset -P '\('; then - local match - compset -S '\)*' - - if [[ $PREFIX = (#b)*([bns])(?|)(*) ]]; then - local f=$match[1] d=$match[2] e=$match[2] v=$match[3] - [[ $f = s && ${(Pt)${compstate[parameter]}} != scalar* ]] && return 1 - if [[ -z $d ]]; then - _message -e delimiters 'delimiter' - return - else - case $d in - (\() e=\);; - (\[) e=\];; - (\{) e=\};; - esac - if [[ $v != *$e* ]]; then - case $f in - (s) _message 'separator string';; - (b|n) [[ $v = <-># ]] && _message 'number' || return 1;; - esac - [[ -n $v && $SUFFIX$ISUFFIX != *$e* ]] && _message 'delimiter' - return 0 - fi - fi - fi - - case ${(Pt)${compstate[parameter]}} in - assoc*) flags=( - '(R k K i I)r[any one value matched by subscript as pattern]' - '(r k K i I)R[all values matched by subscript as pattern]' - '(r R K i I)k[any one value where subscript matched by key as pattern]' - '(r R k i I)K[all values where subscript matched by key as pattern]' - '(r R k K I)i[any one key matched by subscript as pattern]' - '(r R k K i)I[all keys matched by subscript as pattern]' - 'e[interpret * or @ as a single key]' - );; - (|scalar*)) flags=( - 'f[make subscripting work on lines of scalar]' - 'w[make subscripting work on words of scalar]' - 's[specify word separator]' - 'p[recognise escape sequences in subsequent s flag]' - );& - array*) flags=($flags - 'e[interpret * or @ as a single key and use plain string matching]' - 'n[Nth lowest/highest index with i/I/r/R flag]' - 'b[begin with specified element]' - '(r R k K i)I[highest index of value matched by subscript]' - '(r R k K I)i[lowest index of value matched by subscript]' - '(r k K i I)R[value matched by subscript at highest index]' - '(R k K i I)r[value matched by subscript at lowest index]' - );; - esac - - _values -s '' 'subscript flags' $flags -elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then - local suf MATCH MBEGIN MEND - local -a keys - keys=("${(@)${(@k)${(P)compstate[parameter]}}//(#m)[\$\\\[\]\(\)\{\}]/\\$MATCH}") - keys=("${(@)keys//#%(#m)[*@]/(e)$MATCH}") - [[ "$RBUFFER" != (|\\)\]* ]] && suf="$osuf" - - _wanted association-keys expl 'association key' \ - compadd -Q -S "$suf" -a keys -elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then - local list i j ret=1 disp - - _tags indexes parameters - - while _tags; do - if _requested indexes; then - ind=( {1..${#${(P)${compstate[parameter]}}}} ) - if zstyle -T ":completion:${curcontext}:indexes" verbose; then - list=() - for i in "$ind[@]"; do - if [[ "$i" = ${PREFIX}*${SUFFIX} ]]; then - list+=( "${i}:$(print -D -- ${(P)${compstate[parameter]}[$i]})" ) - else - list+=( '' ) - fi - done - zstyle -s ":completion:${curcontext}:indexes" list-separator sep || sep=-- - zformat -a list " $sep " "$list[@]" - disp=( -d list) - else - disp=() - fi - - if [[ "$RBUFFER" = (|\\)\]* ]]; then - _all_labels -V indexes expl 'array index' \ - compadd -S '' "$disp[@]" -a ind && ret=0 - else - _all_labels -V indexes expl 'array index' \ - compadd -S "$osuf" "$disp[@]" -a ind && ret=0 - fi - fi - _requested parameters && _parameters && ret=0 - - (( ret )) || return 0 - done - - return 1 -else - _dispatch -math- -math- -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_suffix_alias_files b/zsh_arm64/system/usr/share/zsh/functions/_suffix_alias_files deleted file mode 100644 index 1c2c8eb..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_suffix_alias_files +++ /dev/null @@ -1,21 +0,0 @@ -#autoload - -# Complete files for which a suffix alias exists. - -local expl pat - -(( ${#saliases} )) || return 1 - -if (( ${#saliases} == 1 )); then - pat="*.${(kq)saliases}" -else - local -a tmpa - # This is so we can quote the alias names against expansion - # without quoting the `|' which needs to be active in the pattern - # --- remember that an alias name can be pretty much anything. - tmpa=(${(kq)saliases}) - pat="*.(${(kj.|.)tmpa})" -fi - -# _wanted is called for us by _command_names -_path_files "$@" -g $pat diff --git a/zsh_arm64/system/usr/share/zsh/functions/_tags b/zsh_arm64/system/usr/share/zsh/functions/_tags deleted file mode 100644 index 63087e2..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_tags +++ /dev/null @@ -1,67 +0,0 @@ -#autoload - -local prev - -# A `--' as the first argument says that we should tell comptags to use -# the preceding function nesting level. This is only documented here because -# if everything goes well, users won't have to worry about it and should -# not mess with it. - -if [[ "$1" = -- ]]; then - prev=- - shift -fi - -if (( $# )); then - - # We have arguments: the tags supported in this context. - - local curcontext="$curcontext" order tag nodef tmp - - if [[ "$1" = -C?* ]]; then - curcontext="${curcontext%:*}:${1[3,-1]}" - shift - elif [[ "$1" = -C ]]; then - curcontext="${curcontext%:*}:${2}" - shift 2 - fi - - [[ "$1" = -(|-) ]] && shift - - zstyle -a ":completion:${curcontext}:" group-order order && - compgroups "$order[@]" - - # Set and remember offered tags. - - comptags "-i$prev" "$curcontext" "$@" - - # Sort the tags. - - if [[ -n "$_sort_tags" ]]; then - "$_sort_tags" "$@" - else - zstyle -a ":completion:${curcontext}:" tag-order order || - (( ! ${@[(I)options]} )) || - order=('(|*-)argument-* (|*-)option[-+]* values' options) - - for tag in $order; do - case $tag in - -) nodef=yes;; - \!*) comptry "${(@)argv:#(${(j:|:)~${=~tag[2,-1]}})}";; - ?*) comptry -m "$tag";; - esac - done - - [[ -z "$nodef" ]] && comptry "$@" - fi - - # Return non-zero if at least one set of tags should be used. - - comptags "-T$prev" - - return -fi - -# The other mode: switch to the next set of tags. - -comptags "-N$prev" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_tcpsys b/zsh_arm64/system/usr/share/zsh/functions/_tcpsys deleted file mode 100644 index 1240ffb..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_tcpsys +++ /dev/null @@ -1,41 +0,0 @@ -#compdef tcp_open - -local curcontext="$curcontext" state line expl -local -A opt_args -local -a argargs sesslist - -case $service in - (tcp_open) - argargs=( - '(-a -f -l)-s[open session(s)]' - '(-a -f -s)-l[open list of sessions]' - '(-f -s -l)-a[open session for accept on fd]:fd' - '(-a -s -l)-f[open session for accept on fd]:fd' - '-q[quiet mode]' - '-z[no zle handler]' - ) - if [[ -n $words[(R)-(a|f)*] ]]; then - argargs+=(':session:->session') - elif [[ -n $words[(R)-(l|s)*] ]]; then - argargs+=('*:session:->session') - else - argargs+=(':host:_hosts' ':port:_ports' '*:session:->session') - fi - _arguments -C $argargs - ;; -esac - -while (( $#state )); do - case "$state[1]" in - (sessionlist) - compset -P '*,' - ;& - - (session) - sesslist=(${${${(f)"$(<~/.ztcp_sessions)"}:#[[:space:]]#\#*}/ /:}) - _describe -t sessions 'TCP session' sesslist && return - ;; - - esac - shift state -done diff --git a/zsh_arm64/system/usr/share/zsh/functions/_tilde b/zsh_arm64/system/usr/share/zsh/functions/_tilde deleted file mode 100644 index 4b5cfaa..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_tilde +++ /dev/null @@ -1,32 +0,0 @@ -#compdef -tilde- - -# We use all named directories and user names here. If this is too slow -# for you or if there are too many of them, you may want to use -# `compadd -qS/ -a friends' or something like that. - -[[ -n "$compstate[quote]" ]] && return 1 - -local expl suf ret=1 - -if [[ "$SUFFIX" = */* ]]; then - ISUFFIX="/${SUFFIX#*/}$ISUFFIX" - SUFFIX="${SUFFIX%%/*}" - suf=(-S '') -else - suf=(-qS/) -fi - -_tags users named-directories directory-stack - -while _tags; do - _requested users && _users "$suf[@]" "$@" && ret=0 - - _requested named-directories expl 'named directory' \ - compadd "$suf[@]" "$@" -k nameddirs && ret=0 - - _requested directory-stack && _directory_stack "$suf[@]" && ret=0 - - (( ret )) || return 0 -done - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_trap b/zsh_arm64/system/usr/share/zsh/functions/_trap deleted file mode 100644 index 0fc9ec2..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_trap +++ /dev/null @@ -1,10 +0,0 @@ -#compdef trap - -local expl - -if [[ CURRENT -eq 2 ]]; then - compset -q - _normal -else - _signals -a -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_ttyctl b/zsh_arm64/system/usr/share/zsh/functions/_ttyctl deleted file mode 100644 index 45527b0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_ttyctl +++ /dev/null @@ -1,4 +0,0 @@ -#compdef ttyctl - -_arguments '(-u)-f[freeze terminal settings]' \ - '(-f)-u[unfreeze terminal settings]' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_typeset b/zsh_arm64/system/usr/share/zsh/functions/_typeset deleted file mode 100644 index fb7189c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_typeset +++ /dev/null @@ -1,147 +0,0 @@ -#compdef autoload declare export functions integer float local readonly typeset - -local expl state line func i use curcontext="$curcontext" -local fopts="-f -k -z +k +z" -local popts="-A -E -F -L -R -T -Z -a -g -h -H -i -l -r -x" -local -A allargs opt_args -local -a args - -allargs=( - A "($fopts -E -F -L -R -T -U -Z -a -i -m)-A[specify that arguments refer to associative arrays]" - E "($fopts -A -F -L -R -T -U -Z -a -i -m)-E[floating point, use engineering notation on output]" - F "($fopts -A -E -L -R -T -U -Z -a -i -m)-F[floating point, use fixed point decimal on output]" - L "($fopts -A -E -F -i)-L+[left justify and remove leading blanks from value]:width" - R "($fopts -A -E -F -i)-R+[right justify and fill with leading blanks]:width" - T "($fopts -A -E -F -a -g -h -i -l -m -t)-T[tie scalar to array or trace function]" - Tf "($popts -t)-T[trace execution of this function only]" - Tp "($fopts -A -E -F -a -g -h -i -l -m -t)-T[tie scalar to array]" - U '(-A -E -F -i)-U[keep array values unique and suppress alias expansion for functions]' - Uf '-U[suppress alias expansion for functions]' - Up '(-E -F -i)-+U[keep array values unique]' - X '+X[immediately autoload function]' - Z "($fopts -A -E -F -i)-Z+[right justify and fill with leading zeros]:width" - a "($fopts -A -E -F -T -i)-a[specify that arguments refer to arrays]" - df "-d[default absolute path autoload to fpath]" - f "($popts)-f[specify that arguments refer to functions]" - g "($fopts -T)-+g[do not restrict parameter to local scope]" - h "($fopts -T)-+h[hide specialness of parameter]" - H "($fopts -T)-+H[hide value of parameter in listings]" - i "($fopts -A -E -F -T)-+i[represent internally as an integer]" - k "($popts -w -z)-+k[mark function for ksh-style autoloading]" - l "($popts -T)-l[convert the value to lowercase]" - m '(-A -E -F -T -i)-m[treat arguments as patterns]' - p '-p+[output parameters in form of calls to typeset]::option:((1\:multi-line\ output\ of\ arrays))' - r '(-f)-+r[mark parameters as readonly]' - rf '-r[remember autoload path]' - Rf '-R[remember autoload path, error if not found]' - t '(-T)-+t[tag parameters and turn on execution tracing for functions]' - tf '(-T)-+t[turn on execution tracing for functions]' - tp '(-T)-+t[tag parameters]' - u '-u[convert the value to uppercase or mark function for autoloading]' - uf '-u[mark function for autoloadling]' - up '-u[convert the value to uppercase]' - w '(-k -z)-w[specify that arguments refer to files compiled with zcompile]' - W '-+W[turn on WARN_NESTED_VAR for function]' - x "($fopts)-+x[export parameter]" - z "($popts -k -w)-+z[mark function for zsh-style autoloading]" -) - -use="AEFHLRTUZafghiklmprtuxz" - -case ${service} in - autoload) - use="URTXdkrtwz" - func=f - ;; - float) use="EFHghlprtux";; - functions) - use="UkmTtuzW" - func=f - args=( - '(-k -t -T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]' - '(-k -m -t -T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]' - '(-M)-x+[specify spaces to use for indentation]:spaces' - ) - ;; - integer) - use="Hghilprtux" - allargs[i]='-i+[specify arithmetic base for output]:: :_guard "[0-9]#" base' \ - ;; - readonly) use="${use/r/}" ;; - local) use="${use/[fkz]/}" ;& - export) use="${${use//[gkz]/}/x/}" ;; -esac - -[[ -z "${words[(r)-*[aA]*]}" ]] || func=p -[[ -z "${words[(r)-*f*]}" ]] || func=f - -# This function uses whacky features of _arguments which means we -# need to look for options to the command beforehand. -local onopts offopts -onopts=${(j..)${${words[1,CURRENT-1]:#^-*}##-}} -offopts=${(j..)${${words[1,CURRENT-1]:#^+*}##+}} - -for ((i=1;i<=$#use;++i)); do - args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[dUurRtT]]:+$func}]} ) -done - -_arguments -C -s -A "-*" -S "${args[@]}" '*::vars:= ->vars_eq' - -if [[ "$state" = vars_eq ]]; then - if [[ $func = f ]]; then - if (( $+opt_args[+M] || ( $+opt_args[-M] && $+opt_args[-m] ) )); then - _wanted functions expl 'math function' compadd -F line - \ - ${${${(f)"$(functions -M)"}##*-M }%% *} - elif (( $+opt_args[-M] )); then - _arguments ':new math function:_functions' \ - ":minimum arguments${(k)opt_args[-s]:+:(1)}" \ - ":maximum arguments${(k)opt_args[-s]:+:(1)}" \ - ':shell function:_functions' - elif (( $+opt_args[-w] )); then - _wanted files expl 'zwc file' _files -g '*.zwc(-.)' - elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then - if [[ $PREFIX[1] = [/~] ]]; then - # Autoload by absolute path - _files - else - args=(${^fpath}/*(-.:t)) - # Filter out functions already loaded or marked for autoload. - local -a funckeys - funckeys=(${(k)functions}) - args=(${args:|funckeys}) - _wanted functions expl 'shell function' compadd -a args - fi - elif [[ -n $onopts$offopts ]]; then - if [[ -n $offopts ]]; then - args=(${(f)"$(functions +${offopts//[^UXkmtTuz]/})"}) - else - args=(${(k)functions}) - fi - if [[ -n $onopts ]]; then - local -a funckeys - funckeys=(${(f)"$(functions +${onopts//[^UXkmtTuz]/})"}) - args=(${args:|funckeys}) - fi - if zstyle -t ":completion:${curcontext}:functions" prefix-needed && - [[ $PREFIX != [_.]* ]]; then - args=(${args:#_*}) - fi - _wanted functions expl 'shell functions' compadd -a args - else - _functions - fi - elif [[ "$PREFIX" = *\=* ]]; then - compstate[parameter]="${PREFIX%%\=*}" - compset -P 1 '*=' - _value - elif (( $+opt_args[-a] || $+opt_args[-A] )); then - _parameters -q - elif (( $+opt_args[-T] )); then - _arguments \ - ':scalar parameter:_parameters -g "*scalar*" -q -S "="' \ - ':array parameter:_parameters -g "*array*"' \ - ':separator character' - else - _parameters -q -S '=' - fi -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_ulimit b/zsh_arm64/system/usr/share/zsh/functions/_ulimit deleted file mode 100644 index 0526821..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_ulimit +++ /dev/null @@ -1,19 +0,0 @@ -#compdef ulimit - -[[ $PREFIX = u* ]] && compadd unlimited && return 0 - -_arguments -s \ - '-H[set hard limits]' \ - '-S[set soft and hard limits (with -H)]' \ - '(-H -S -c -d -f -l -m -n -s -t *)-a[list all current resource limits]' \ - '-c[core dump size limit]:max core dump size (512-byte blocks)' \ - '-d[maximum size of data segment]:maximum size of data segment (K-bytes)' \ - '-f[size of largest file allowed]:size of largest file allowed (512-byte blocks)' \ - '-l[maximum size of locked in memory]:maximum size of locked in memory (K-bytes)' \ - '-m[maximum size of physical memory]:maximum size of physical memory (K-bytes)' \ - '-n[maximum no. of open file descriptors]:maximum no. of open file descriptors' \ - '-s[stack size limit]:stack size limit (K-bytes)' \ - '-t[maximum cpu time per process]:maximum cpu time per process (seconds)' \ - '-u[processes available to the user]:processes' \ - '-v[maximum size of virtual memory]:maximum size of virtual memory (K-bytes)' \ - '*:size of largest file allowed' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_unhash b/zsh_arm64/system/usr/share/zsh/functions/_unhash deleted file mode 100644 index ff0c03f..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_unhash +++ /dev/null @@ -1,9 +0,0 @@ -#compdef unhash - -_arguments -s -S \ - '(-a -f -s *)-d[remove named directories]:*:named directory:compadd -k nameddirs' \ - '(-d -f -s *)-a[remove aliases]:*:alias:_aliases' \ - '(-a -d -f *)-s[remove suffix aliases]:*:suffix alias:_aliases -s s' \ - '(-d -a -s *)-f[remove functions]:*:shell function:_functions' \ - '-m[treat arguments as patterns]' \ - '(-a -d -f -m)*:command: _command_names -e' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_user_expand b/zsh_arm64/system/usr/share/zsh/functions/_user_expand deleted file mode 100644 index ee39bb1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_user_expand +++ /dev/null @@ -1,147 +0,0 @@ -#autoload - -# This completer function is an addition to the _expand completer that -# allows the user to define their own expansions. It does not replace -# the _expand completer. -# -# This function will allow other completer functions to be called if -# the expansions done produce no result or do not change the original -# word from the line. - -setopt localoptions nonomatch - -[[ _matcher_num -gt 1 ]] && return 1 - -local exp word sort expr expl subd suf=" " asp tmp spec REPLY -local -a specs reply - -if [[ "$funcstack[2]" = _prefix ]]; then - word="$IPREFIX$PREFIX$SUFFIX" -else - word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" -fi - -# In exp we will collect the expansions. - -exp=("$word") - -# Now look for user completions. - -zstyle -a ":completion:${curcontext}:" user-expand specs || return 1 - -for spec in $specs; do - REPLY= - case $spec in - ('$'[[:IDENT:]]##) - # Spec is an associative array with explicit keys. - # Surely there's a better way of doing an associative array - # lookup from its name? - eval tmp='${'$spec[2,-1]'[$word]}' - if [[ -n $tmp ]]; then - exp=("$tmp") - break - fi - ;; - - ('_'*) - reply=() - $spec $word - if (( ${#reply} )); then - exp=("${reply[@]}") - break - fi - ;; - esac -done - -[[ $#exp -eq 1 && "$exp[1]" = "$word" ]] && return 1 - -# Now add as matches whatever the user requested. - -zstyle -s ":completion:${curcontext}:" sort sort - -[[ "$sort" = (yes|true|1|on) ]] && exp=( "${(@o)exp}" ) - -if zstyle -s ":completion:${curcontext}:" add-space tmp; then - if [[ "$tmp" != *subst* || "$word" != *\$* || "$exp[1]" = *\$* ]]; then - [[ "$tmp" = *file* ]] && asp=file - [[ "$tmp" = *(yes|true|1|on|subst)* ]] && asp="yes$asp" - fi -else - asp=file -fi - -# If there is only one expansion, add a suitable suffix - -if (( $#exp == 1 )); then - if [[ -d ${exp[1]} && "$exp[1]" != */ ]]; then - suf=/ - elif [[ "$asp" = yes* || - ( "$asp" = *file && -f "${exp[1]}" ) ]]; then - suf=' ' - else - suf= - fi -fi - -if [[ -z "$compstate[insert]" ]] ;then - if [[ "$sort" = menu ]]; then - _description expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" - else - _description -V expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" - fi - - compadd "$expl[@]" -UQ -qS "$suf" -a exp -else - _tags all-expansions expansions original - - if [[ $#exp -ge 1 ]] && _requested expansions; then - local i j normal space dir - - if [[ "$sort" = menu ]]; then - _description expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" - else - _description -V expansions expl "expansions${REPLY:+: $REPLY}" "o:$word" - fi - normal=() - space=() - dir=() - - for i in "$exp[@]"; do - j="${i}" - if [[ -d "$j" && "$i" != */ ]]; then - dir=( "$dir[@]" "$i" ) - elif [[ "$asp" = yes* || ( "$asp" = *file && -f "$j" ) ]]; then - space=( "$space[@]" "$i" ) - else - normal=( "$normal[@]" "$i" ) - fi - done - (( $#dir )) && compadd "$expl[@]" -UQ -qS/ -a dir - (( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space - (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal - fi - if _requested all-expansions; then - local disp dstr - - if [[ "$sort" = menu ]]; then - _description all-expansions expl "all expansions${REPLY:+: $REPLY}" "o:$word" - else - _description -V all-expansions expl "all expansions${REPLY:+: $REPLY}" "o:$word" - fi - if [[ "${#${exp}}" -ge COLUMNS ]]; then - disp=( -ld dstr ) - dstr=( "${(r:COLUMNS-5:)exp} ..." ) - else - disp=() - fi - [[ -o multios ]] && exp=($exp[1] $compstate[redirect]${^exp[2,-1]}) - compadd "$disp[@]" "$expl[@]" -UQ -qS "$suf" - "$exp" - fi - - _requested original expl original && compadd "$expl[@]" -UQ - "$word" - - compstate[insert]=menu -fi - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_user_math_func b/zsh_arm64/system/usr/share/zsh/functions/_user_math_func deleted file mode 100644 index 35a49d5..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_user_math_func +++ /dev/null @@ -1,9 +0,0 @@ -#autoload - -local expl -local -a funcs - -funcs=(${${${(f)"$(functions -M)"}##functions -M }%% *}) - -_wanted user-math-functions expl 'user math function' \ - compadd -S '(' -q "$@" -a funcs diff --git a/zsh_arm64/system/usr/share/zsh/functions/_value b/zsh_arm64/system/usr/share/zsh/functions/_value deleted file mode 100644 index 5e74100..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_value +++ /dev/null @@ -1,50 +0,0 @@ -#compdef -value- -array-value- -value-,-default-,-default- - -# You can customize completion for different parameters by writing -# functions with the tag-line `#compdef -value-,,' where -# is the name of the parameter (or name-key when completing an -# associative array value) and is either `-default-' or the -# name of the command from the command-line. - -if [[ "$service" != -value-,* ]]; then - local strs ctx= - - strs=( -default- ) - - if [[ "$compstate[context]" != *value && -n "$_comp_command1" ]]; then - ctx="${_comp_command}" - strs=( "${_comp_command1}" "$strs[@]" ) - [[ -n "$_comp_command2" ]] && - strs=( "${_comp_command2}" "$strs[@]" ) - fi - - _dispatch -value-,${compstate[parameter]},$ctx \ - -value-,{${compstate[parameter]},-default-},${^strs} -else - if [[ "$compstate[parameter]" != *-* && - "$compstate[context]" = array_value && - "${(Pt)${compstate[parameter]}}" = assoc* ]]; then - local expl - if (( CURRENT & 1 )); then - _wanted association-keys expl 'association key' \ - compadd -k "$compstate[parameter]" - else - compstate[parameter]="${compstate[parameter]}-${words[CURRENT-1]}" - - _dispatch -value-,${compstate[parameter]}, \ - -value-,{${compstate[parameter]},-default-},-default- - fi - else - local pats - - if { zstyle -a ":completion:${curcontext}:" assign-list pats && - [[ "$compstate[parameter]" = (${(j:|:)~pats}) ]] } || - [[ "$PREFIX$SUFFIX" = *:* ]]; then - compset -P '*:' - compset -S ':*' - _default -r '\-\n\t /:' "$@" - else - _default "$@" - fi - fi -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_values b/zsh_arm64/system/usr/share/zsh/functions/_values deleted file mode 100644 index 6e38e00..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_values +++ /dev/null @@ -1,160 +0,0 @@ -#autoload - -local subopts opt usecc garbage keep - -subopts=() -zparseopts -D -a garbage s+:=keep S+:=keep w+=keep C=usecc O:=subopts \ - M: J: V: 1 2 n F: X: - -(( $#subopts )) && subopts=( "${(@P)subopts[2]}" ) - -if compvalues -i "$keep[@]" "$@"; then - - local noargs args opts descr action expl sep argsep subc test='*' - local oldcontext="$curcontext" - - compvalues -S argsep - compvalues -s sep && [[ -n "$sep" ]] && test="[^${(q)sep}]#" - - if ! compvalues -D descr action; then - - _tags values || return 1 - - curcontext="${oldcontext%:*}:values" - - compvalues -V noargs args opts - - if [[ -n "$argsep" && "$PREFIX" = *${argsep}${~test} ]]; then - local name - - name="${PREFIX%%${argsep}*}" - if compvalues -L "$name" descr action; then - IPREFIX="${IPREFIX}${name}${argsep}" - PREFIX="${PREFIX#*${argsep}}" - else - local prefix suffix - - prefix="${PREFIX#*${argsep}}" - suffix="$SUFFIX" - PREFIX="$name" - SUFFIX='' - args=( "$args[@]" "$opts[@]" ) - compadd -M 'r:|[_-]=* r:|=*' -D args - "${(@)args[@]%%:*}" - - [[ $#args -ne 1 ]] && return 1 - - PREFIX="$prefix" - SUFFIX="$suffix" - IPREFIX="${IPREFIX}${args[1]%%:*}${argsep}" - compvalues -L "${args[1]%%:*}" descr action subc - curcontext="${oldcontext%:*}:$subc" - fi - else - compvalues -d descr - if compvalues -s sep; then - sep=( "-qS" "$sep" ) - else - sep=() - fi - - _describe "$descr" \ - noargs "$sep[@]" -M 'r:|[_-]=* r:|=*' -- \ - args -S "${argsep}" -M 'r:|[_-]=* r:|=*' -- \ - opts -qS "${argsep}" -r "${argsep}${sep} \\t\\n\\-" -M 'r:|[_-]=* r:|=*' - - curcontext="$oldcontext" - - return - fi - else - compvalues -C subc - curcontext="${oldcontext%:*}:$subc" - fi - - if ! _tags arguments; then - curcontext="$oldcontext" - return 1 - fi - - _description arguments expl "$descr" - - # We add the separator character as a autoremovable suffix unless - # we have only one possible value left. - - sep=() - [[ ${#snames}+${#names}+${#onames} -ne 1 ]] && compvalues -s sep && - expl=( "-qS$sep" "$expl[@]" ) sep=( "-qS$sep" ) - - if [[ "$action" = -\>* ]]; then - compvalues -v val_args - state="${${action[3,-1]##[ ]#}%%[ ]#}" - state_descr="$descr" - if [[ -n "$usecc" ]]; then - curcontext="${oldcontext%:*}:$subc" - else - context="$subc" - fi - compstate[restore]='' - return 1 - else - typeset -A val_args - - compvalues -v val_args - - if [[ "$action" = \ # ]]; then - - # An empty action means that we should just display a message. - - _message -e arguments "$descr" - return 1 - - elif [[ "$action" = \(\(*\)\) ]]; then - local ws - - # ((...)) contains literal strings with descriptions. - - eval ws\=\( "${action[3,-3]}" \) - - _describe "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" "$sep[@]" - - elif [[ "$action" = \(*\) ]]; then - - # Anything inside `(...)' is added directly. - - eval ws\=\( "${action[2,-2]}" \) - - _all_labels arguments expl "$descr" compadd "$subopts[@]" "$sep[@]" -a - ws - elif [[ "$action" = \{*\} ]]; then - - # A string in braces is evaluated. - - while _next_label arguments expl "$descr"; do - eval "$action[2,-2]" - done - elif [[ "$action" = \ * ]]; then - - # If the action starts with a space, we just call it. - - eval "action=( $action )" - while _next_label arguments expl "$descr"; do - "$action[@]" - done - else - - # Otherwise we call it with the description-arguments built above. - - eval "action=( $action )" - while _next_label arguments expl "$descr"; do - "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}" - done - fi - fi - - curcontext="$oldcontext" - - [[ nm -ne "$compstate[nmatches]" ]] -else - curcontext="$oldcontext" - - return 1; -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_vared b/zsh_arm64/system/usr/share/zsh/functions/_vared deleted file mode 100644 index aba6488..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_vared +++ /dev/null @@ -1,14 +0,0 @@ -#compdef vared - -_arguments -s -A "-*" \ - '(-a)-A[edit associative array]' \ - '(-A)-a[edit array parameter]' \ - "-c[create parameter or change type]" \ - '-p+[specify left prompt]:prompt' \ - '-r+[specify right prompt]:right prompt' \ - '-i+[specify initialisation widget]:widget:_widgets' \ - '-f+[specify finish widget]:widget:_widgets' \ - '-h[allow access to history]' \ - '-e[exit on EOF (^D)]' \ - '1:parameter spec:_vars' - diff --git a/zsh_arm64/system/usr/share/zsh/functions/_vars b/zsh_arm64/system/usr/share/zsh/functions/_vars deleted file mode 100644 index ec59c03..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_vars +++ /dev/null @@ -1,25 +0,0 @@ -#compdef getopts unset - -# This will handle completion of keys of associative arrays, e.g. at -# `vared foo[' could complete to `vared foo[key]'. - -local ret=1 - -if [[ $PREFIX = *\[* ]]; then - compstate[parameter]=${PREFIX%%(|\\)\[*} - - IPREFIX=${PREFIX%%\[*}\[ - PREFIX=${PREFIX#*\[} - - _subscript -q -else - _parameters -g '^a*' "$@" && ret=0 - - if compset -S '\[*'; then - set - -S "" "$@" - else - set - -qS"${${QIPREFIX:+[}:-\[}" "$@" - fi - _parameters -g 'a*' "$@" && ret=0 - return ret -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_wait b/zsh_arm64/system/usr/share/zsh/functions/_wait deleted file mode 100644 index c007cab..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_wait +++ /dev/null @@ -1,3 +0,0 @@ -#compdef wait - -_alternative 'processes:: _pids' 'jobs:: _jobs -t' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_wanted b/zsh_arm64/system/usr/share/zsh/functions/_wanted deleted file mode 100644 index 5bba7fd..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_wanted +++ /dev/null @@ -1,13 +0,0 @@ -#autoload - -local -a __targs __gopt - -zparseopts -D -a __gopt 1 2 V J x C:=__targs - -_tags "$__targs[@]" "$1" - -while _tags; do - _all_labels "$__gopt[@]" "$@" && return 0 -done - -return 1 diff --git a/zsh_arm64/system/usr/share/zsh/functions/_which b/zsh_arm64/system/usr/share/zsh/functions/_which deleted file mode 100644 index 9b789c8..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_which +++ /dev/null @@ -1,41 +0,0 @@ -#compdef which whence where type - -local farg aarg xarg cargs args state line curcontext="$curcontext" ret=1 - -cargs=( \ - '(-v -c)-w[print command type]' \ - '-p[always do a path search]' \ - '-m[treat the arguments as patterns]' \ - '(-S)-s[print symlink free path as well]' \ - '(-s)-S[show steps in the resolution of symlinks]' \ - '*:commands:->command' ) -farg='-f[output contents of functions]' -aarg='-a[print all occurrences in path]' -xarg='-x+[specify spaces to use for indentation in function expansion]:spaces' - -case ${service} in - whence) - _arguments -C -s -A "-*" -S \ - '(-c -w)-v[verbose output]' \ - '(-v -w)-c[csh-like output]' \ - "${cargs[@]}" "$farg" "$aarg" && ret=0 - ;; - where) _arguments -C -s -A "-*" -S "${cargs[@]}" "$xarg" && ret=0;; - which) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$xarg" && ret=0;; - type) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$farg" && ret=0;; -esac - -if [[ "$state" = command ]]; then - - args=( "$@" ) - - _alternative -O args \ - 'commands:external command:_path_commands' \ - 'builtins:builtin command:compadd -k builtins' \ - 'functions:shell function:compadd -k functions' \ - 'aliases:alias:compadd -k aliases' \ - 'reserved-words:reserved word:compadd -k reswords' && ret=0 - -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_widgets b/zsh_arm64/system/usr/share/zsh/functions/_widgets deleted file mode 100644 index fdab281..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_widgets +++ /dev/null @@ -1,9 +0,0 @@ -#autoload - -local expl pattern - -pattern=( -g \* ) -zparseopts -D -K -E g:=pattern - -_description widgets expl widget -compadd "$@" "$expl[@]" -M 'r:|-=* r:|=*' - "${(@k)widgets[(R)${pattern[2]}]}" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zargs b/zsh_arm64/system/usr/share/zsh/functions/_zargs deleted file mode 100644 index f974ab6..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zargs +++ /dev/null @@ -1,48 +0,0 @@ -#compdef zargs -value-,-default-,-command- - -local arguments eofstr pos=$((CURRENT)) numeofs=0 ret=1 cmdpos=1 - -#this doesn't handle '--' on the command line, only -- -#it also by extension doesn't handle eofstr being the empty string -#it also doesn't handle eofstr being -e or --eof, and everything will -# probably also be confused if the command at the end takes a -e, --eof= or -- -eofstr=${${${${words[(r)(--eof=*|-e*)]}#--eof=}#-e}:---} -while { - pos=$(( words[(b:pos-1:I)$eofstr] )) - (( numeofs == 0 )) && (( cmdpos = pos )) - (( pos )) && (( numeofs++ )) - (( pos )) -} {} -case $numeofs in - 0) - #zargs arguments - arguments=( - '(--eof -e)'{--eof=,-e+}'[change the end-of-input-args string from "--" to eof-str]' - '(--exit, -x)'{--exit,-x}'[exit if the size (see --max-chars) is exceeded]' - '--help[print summary and exit]' - '(--interactive, -p)'{--interactive,-p}'[prompt before executing each command line]' - '(--max-args, -n)'{--max-args=,-n+}'[use at most max-args arguments per command line]' - '(--max-chars, -s)'{--max-chars=,-s+}'[use at most max-chars characters per command line]' - '(--max-lines, -l)'{--max-lines=,-l+}'[use at most max-lines of the input-args per command line]' - '(--max-procs, -P)'{--max-procs=,-P+}'[run up to max-procs command lines in the background at once]' - '(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[do nothing if there are no input arguments before the eof-str]' - '(--null, -0)'{--null,-0}'[split each input-arg at null bytes, for xargs compatibility]' - '(--replace, -i)'{--replace=,-i}'[substitute replace-str in the initial-args by each initial-arg]' - '(--verbose, -t)'{--verbose,-t}'[print each command line to stderr before executing it]' - '--version[print the version number of zargs and exit]' - ) - _arguments -S -s $arguments[@] && ret=0 - ;; - 1) - #argument list for command - _files && ret=0 - ;; - *) - #command and command arguments - shift cmdpos words - (( CURRENT -= cmdpos )) - _normal - ;; -esac - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zattr b/zsh_arm64/system/usr/share/zsh/functions/_zattr deleted file mode 100644 index e48047f..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zattr +++ /dev/null @@ -1,35 +0,0 @@ -#compdef zgetattr zsetattr zdelattr zlistattr - -local context state line expl ret=1 REPLY - -case $service in -zgetattr) -_arguments \ - '1:file:_files' \ - '2:attribute:->attrs' \ - '3:parameter' -;; -zsetattr) -_arguments \ - '1:file:_files' \ - '2:attribute:->attrs' \ - '3:value' -;; -zdelattr) -_arguments \ - '1:file:_files' \ - '2:attribute:->attrs' -;; -zlistattr) -_arguments \ - '1:file:_files' \ - '2:parameter' -;; -esac && ret=0 - -if [[ $state = attrs ]]; then - zlistattr ${(Q)${~line[1]}} REPLY 2> /dev/null - _wanted -C "$context[1]" attrs expl 'attribute' compadd -a REPLY && ret=0 -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zcalc b/zsh_arm64/system/usr/share/zsh/functions/_zcalc deleted file mode 100644 index 093a7a9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zcalc +++ /dev/null @@ -1,7 +0,0 @@ -#compdef zcalc - -_arguments -s -w -S : \ - '-#[specify default base]:base: ' \ - '-f[force floating point for all expressions]' \ - '-e[treat command line as expressions to be output immediately]' \ - '*:expression: ' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zcalc_line b/zsh_arm64/system/usr/share/zsh/functions/_zcalc_line deleted file mode 100644 index 50fb8c1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zcalc_line +++ /dev/null @@ -1,81 +0,0 @@ -#compdef -zcalc-line- - -# This handles completion of a zcalc command line read via vared. - -_zcalc_line_escapes() { - local -a cmds - cmds=( - "!:shell escape" - "q:quit" - "norm:normal output format" - "sci:scientific output format" - "fix:fixed point output format" - "eng:engineering (power of 1000) output format" - "raw:raw output format" - "local:make variables local" - "function:define math function (also \:func or \:f)" - ) - cmds=("\:"${^cmds}) - _describe -t command-escapes "command escapes" cmds -Q -} - -_zcalc_line() { - local expl - - if [[ CURRENT -eq 1 && $words[1] != ":"(\\|)"!"* ]]; then - local -a alts - if [[ $words[1] = (|:*) ]]; then - alts=("command-escapes:command escape:_zcalc_line_escapes") - fi - if [[ $words[1] = (|[^:]*) ]]; then - alts+=("math:math formula:_math") - fi - _alternative $alts - return - fi - - case $words[1] in - (":"(\\|)"!"*) - if [[ $words[1] = ":"(\\|)"!" && CURRENT -gt 1 ]]; then - shift words - (( CURRENT-- )) - else - words[1]=${words[1]##:(\\|)\!} - compset -P ':(\\|)!' - fi - _normal - ;; - - (:function) - # completing already defined user math functions is in fact exactly - # the wrong thing to do since currently zmathfuncdef won't overwrite, - # but it may jog the user's memory... - if (( CURRENT == 2 )); then - _wanted math-functions expl 'math function' \ - compadd -- ${${(k)functions:#^zsh_math_func_*}##zsh_math_func_} - else - _math - fi - ;; - - (:local) - _parameter - ;; - - (:(fix|sci|eng)) - if (( CURRENT == 2 )); then - _message "precision" - fi - ;& - - (:*) - _message "no more arguments" - ;; - - ([^:]*) - _math - ;; - esac -} - -_zcalc_line "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zcompile b/zsh_arm64/system/usr/share/zsh/functions/_zcompile deleted file mode 100644 index 727ead3..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zcompile +++ /dev/null @@ -1,29 +0,0 @@ -#compdef zcompile - -local state line expl curcontext="$curcontext" ret=1 -typeset -A opt_args - -_arguments -C -s \ - "(-t -c -m -a)-U[don't expand aliases]" \ - '(-t -M)-R[mark as read]' \ - '(-t -R)-M[mark as mapped]' \ - '(-t -c -m -a)*-k[ksh-style autoloading]' \ - '(-t -c -m -a)*-z[zsh-style autoloading]' \ - '(-t -U -z -k)-c[currently defined functions]' \ - '(-t -U -z -k)-m[use names as patterns]' \ - '(-t -U -z -k)-a[write autoload functions]' \ - '(-M -R -U -z -k -a -c -m)-t[show table of contents]' \ - '(-M -R -U -a -c -m -t):file:->file' \ - '*:function:->function' && ret=0 - -if [[ $state = function && -n $opt_args[(i)-[ac]] ]]; then - _wanted functions expl 'function to write' compadd -k functions && ret=0 -elif [[ -n $opt_args[(i)-[tca]] ]]; then - _description files expl 'zwc file' - _files -g '*.zwc(-.)' "$expl[@]" && ret=0 -else - _description files expl 'file' - _files "$expl[@]" && ret=0 -fi - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zed b/zsh_arm64/system/usr/share/zsh/functions/_zed deleted file mode 100644 index 6b68fad..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zed +++ /dev/null @@ -1,10 +0,0 @@ -#compdef zed fned - -case $service in -(fned) _arguments -S : ':shell function:_functions';; -(zed) _arguments -S : \ - '(- 2):file:_files' \ - '(1):shell function:_functions' \ - '(1)-x+[specify spaces to use for indentation in function expansion]:spaces' \ - '(1)-f[edit function]';; -esac diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zftp b/zsh_arm64/system/usr/share/zsh/functions/_zftp deleted file mode 100644 index 1055330..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zftp +++ /dev/null @@ -1,93 +0,0 @@ -#compdef -p zf* - -# Completion for zftp builtin and zf* functions. The functions -# zfcd_match and zfget_match (also used for old-style completion) -# need to be installed for remote file and directory completion to work. - -# emulate -L zsh - -# Don't try any more completion after this. -_compskip=all - -local subcom expl curcontext="${curcontext}" - -if [[ $service = zftp ]]; then - if [[ $CURRENT -eq 2 ]]; then - _wanted commands expl sub-command \ - compadd open params user login type ascii binary mode put \ - putat get getat append appendat ls dir local remote mkdir rmdir \ - session rmsession - return - fi - subcom=$words[2] - curcontext="${curcontext/:zftp:/:zftp-${words[2]}:}" -else - subcom=$service -fi - -case $subcom in - *(cd|ls|dir)) - # complete remote directories - [[ -z ${functions[zfcd_match]} ]] && autoload -Uz zfcd_match - _tags directories && zfcd_match $PREFIX $SUFFIX - ;; - - *(get(|at)|gcp|delete|remote)) - # complete remote files - [[ -z ${functions[zfget_match]} ]] && autoload -Uz zfget_match - _tags files && zfget_match $PREFIX $SUFFIX - ;; - - *(put(|at)|pcp)) - # complete local files - _files - ;; - - *(open|anon|params)) - # complete hosts: should do cleverer stuff with user names - _hosts - ;; - - *(goto|mark)) - # complete bookmarks. First decide if ncftp mode is go. - if [[ $words[2] = -*n* ]]; then - if [[ -f ~/.ncftp/bookmarks ]]; then - _wanted bookmarks expl bookmark \ - compadd - $(awk -F, 'NR > 2 { print $1 }' ~/.ncftp/bookmarks) - fi - else - if [[ -f ${ZFTP_BMFILE:=${ZDOTDIR:-$HOME}/.zfbkmarks} ]]; then - _wanted bookmarks expl bookmark \ - compadd - $(awk '{print $1}' $ZFTP_BMFILE) - fi - fi - ;; - - *session) - # complete sessions, excluding the current one. - _wanted sessions expl 'another FTP session' \ - compadd - ${$(zftp session):#$ZFTP_SESSION} - ;; - - *transfer) - # complete arguments like sess1:file1 sess2:file2 - if [[ $PREFIX = *:* ]]; then - # complete file in the given session - _tags files || return 1 - local sess=${PREFIX%%:*} oldsess=$ZFTP_SESSION - compset -p $(( $#sess + 1 )) - [[ -n $sess ]] && zftp session $sess - zfget_match $PREFIX $SUFFIX - [[ -n $sess && -n $oldsess ]] && zftp session $oldsess - else - # note here we can complete the current session - _wanted sessions expl 'FTP session' compadd -S : - $(zftp session) - fi - ;; - - *) - # dunno... try ordinary completion after all. - _compskip='' - return 1 - ;; -esac diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zle b/zsh_arm64/system/usr/share/zsh/functions/_zle deleted file mode 100644 index e01d0a9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zle +++ /dev/null @@ -1,75 +0,0 @@ -#compdef zle - -local expl ret=1 -local -a opts compwids state line context - -compwids=(accept-and-menu-complete - complete-word - delete-char-or-list - expand-or-complete - expand-or-complete-prefix - list-choices - menu-complete - menu-expand-or-complete - reverse-menu-complete) - -opts=(-A -C -D -F -L -M -N -R -T -U -a -c -l -r \* :) - -_arguments -s -S \ - "($opts)-A[define widget alias]:old widget:->widget :new widget:->widget" \ - "($opts)-C[define completion widget]:new widget name:->comp-widget :completion widget:->builtin-comp-widget :widget shell function:->function" \ - "($opts)-D[delete widget]:*:widget:->widget" \ - \(${(j. .)opts:#-[lFT]}')-L[with -l, list as commands]' \ - \(${(j. .)opts:#-[La]}')-l+[list user-defined widgets]:*:-:->listing' \ - \(${(j. .)opts:#-l}')-a[with -l, list all widgets]' \ - "(: * ${(j. .)opts:#-[Lw]})-F[install file descriptor handler]:file descriptor:_file_descriptors::handler:_functions" \ - "!($opts)-K:keymap:compadd -a keymaps" \ - "($opts)-M[display message]:message: " \ - "($opts)-N[define new widget]:widget name:->widget-or-function ::widget shell function:->function" \ - \(${(j. .)opts:#-c}')-R+[redisplay]:*:-:->redisplay' \ - \(${(j. .)opts:#-R}')-c[with -R, clear listing]' \ - "($opts)-U[unget to input stack]:string: " \ - '(: *)-T[manipulate transformations]:transformation:(tc):function:_functions' \ - \(${(j. .)opts:#-T}')-r[remove transformations]' \ - '(-):widget:->widget' \ - '(-)*::widget args:->args' && ret=0 - -[[ $state == listing ]] && - _arguments -s -S '!-l' \ - "(-a)-L[list as commands]" \ - "(-L)-a[list all widgets]" \ - '*:widget name:->widget' && ret=0 - -case "$state[1]" in - (args) - _arguments \ - '(-N)-n[numeric prefix]:number:' \ - '(-n)-N[reset numeric prefix]' \ - '-K[specify temporary keymap]:keymap:compadd -a keymaps' \ - '-w[set $WIDGET to reflect widget being called]' \ - '(-)*:widget arguments: ' && ret=0 - ;; - (widget*) - _wanted -C "$context[1]" widgets expl "${state_descr[1]:-widget}" _widgets && ret=0 - ;& - (function) - [[ $state[1] != *function ]] || # Handle fall-through - _wanted -C "$context[1]" functions expl 'widget shell function' \ - compadd -M 'r:|-=* r:|=*' -k functions && ret=0 - ;; - (comp-widget) - _wanted -C "$context[1]" widgets expl 'completion widget' \ - _widgets -g "(*:|)(.|)(${(j(|))compwids})(|:*)" && ret=0 - ;& - (builtin-comp-widget) - _wanted -C "$context[1]" widgets expl 'builtin completion widget' \ - compadd -M 'r:|-=* r:|=*' -k "widgets[(I)(.|)(${(j(|))compwids})]" && ret=0 - ;; - (redisplay) - _arguments -s -S '!-R' \ - "-c[clear listing]" \ - ":status line" "*:strings to list" && ret=0 - ;; -esac - -return ret diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zmodload b/zsh_arm64/system/usr/share/zsh/functions/_zmodload deleted file mode 100644 index 3416d50..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zmodload +++ /dev/null @@ -1,78 +0,0 @@ -#compdef zmodload - -local suf comp state line expl curcontext="$curcontext" ret=1 NORMARG -typeset -A opt_args -suf=() - -_arguments -n -C -S -s \ - '(-R -P -i -u -d -a -b -c -I -p -f -e -F -m)-A[create module aliases]' \ - '(-)-R[remove module aliases]' \ - '(-A -R -F -L -m -P -l -e)-u[unload module]' \ - '(-d -e -l)-a[autoload module]' \ - '(-c -d -I -p -f -F -P -l -m -A -R)-b[autoload module for builtins]' \ - '(-b -d -I -p -f -F -P -l -m -A -R)-c[autoload module for condition codes]' \ - '(-A -R -F -I -P -a -b -c -e -f -i -l -m -p)-d[list or specify module dependencies]' \ - '(-i -u -d -a -b -c -p -f -L -R)-e[test if modules are loaded]' \ - '(-b -c -d -I -p -F -P -l -m -A -R)-f[autoload module for math functions]' \ - '(-u -b -c -d -p -f -A -R -I)-F[handle features]' \ - '(-u -b -c -d -p -f -A -R -I)-m[treat feature arguments as patterns]' \ - '(-d -e)-i[suppress error if command would do nothing]' \ - '(-d -e -L)-s[suppress error if module is not available]' \ - '(-b -c -d -p -f -F -P -m)-I[define infix condition names]' \ - '(-u -b -c -d -p -f -A -R)-l[list features]' \ - '(-e -u)-L[output in the form of calls to zmodload]' \ - '(-b -c -d -I -f -F -P -l -m -A -R)-p[autoload module for parameters]' \ - '(-u -b -c -d -p -f -A -R)-P[array param for features]:array name:_parameters' \ - '(-)*:params:->params' && ret=0 - -[[ $state = params ]] || return ret - -if (( $+opt_args[-A] )); then - compset -S '=*' || compset -P '*=' || suf=( -S '=' ) -fi - -if (( $+opt_args[-F] && CURRENT > NORMARG )); then - local module=$words[NORMARG] - local -a features - - if [[ $modules[$module] != loaded ]]; then - _message -e features "feature for unloaded module" - else - zmodload -lFP features $module - if compset -P -; then - # only enabled features needed - features=(${${features:#-*}##?}) - elif compset -P +; then - # only disabled features needed - features=(${${features:#+*}##?}) - else - # complete opposite of current feature state, + is default - features=(${${features#-}/(#s)+/-}) - fi - _wanted features expl feature compadd -a features - fi -else - comp=( files aliases ) - if (( $+opt_args[-u] )); then - if (( $+opt_args[-b] || $+opt_args[-a] )); then - comp=( builtins ) - else - comp=( loadedmodules aliases ) - fi - fi - (( $+opt_args[-a] && CURRENT > 3 )) && comp=( builtins ) - - _tags "$comp[@]" - while _tags; do - _requested builtins expl 'builtin command' \ - compadd "$@" -k builtins && ret=0 - _requested loadedmodules expl 'loaded modules' \ - compadd -k 'modules[(R)loaded]' && ret=0 - _requested files expl 'module file' \ - _files -W module_path -g '*.(dll|s[ol]|bundle)(:r)' && ret=0 - _requested aliases expl 'module alias' \ - compadd "$suf[@]" -k 'modules[(R)alias*]' && ret=0 - (( ret )) || return 0 - done - return ret -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zmv b/zsh_arm64/system/usr/share/zsh/functions/_zmv deleted file mode 100644 index df5cb51..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zmv +++ /dev/null @@ -1,18 +0,0 @@ -#compdef zmv zln zcp - -_arguments -s -S -A '-*' \ - '(-C -L -s -p)-M[force mv]' \ - '(-M -L -s -p)-C[force cp]' \ - '(-M -C -p)-L[force ln]' \ - '-f[force overwriting of destination files]' \ - '-i[interactive: prompt for each operation]' \ - '-n[no execution: just print what would happen]' \ - '-Q[force bare glob qualifiers on]' \ - '(-C -M)-s[symbolic, passed down to ln]' \ - '-v[verbose: print line as it is executed]' \ - '-o[specify options to pass to underlying command]: opt string' \ - '(-M -C -L -s)-p+[specify program to run instead of cp, ln or mv]:program:_command_names -e' \ - '(-W)-w[implicitly add parenthesis to wildcards in the pattern]' \ - '(-w)-W[like -w, but turn wildcards in replacement patterns into references]' \ - '1:source pattern:_files' \ - '2:destination pattern:_files' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zpty b/zsh_arm64/system/usr/share/zsh/functions/_zpty deleted file mode 100644 index 99251aa..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zpty +++ /dev/null @@ -1,62 +0,0 @@ -#compdef zpty - -local state line list names expl sep curcontext="$curcontext" -typeset -A opt_args - -_arguments -C -s -S \ - '(-r -w -t -n -L -d)-e[echo input characters]' \ - '(-r -w -t -n -L -d)-b[io to pseudo-terminal blocking]' \ - '(-r -w -t -n -L -e -b)-d[delete command]:*:name:->name' \ - '(-r -L -t -e -b -d)-w[send string to command]:name:->name:*:strings to write' \ - '(-r -L -t -e -b -d)-n[do not add a newline to the result]' \ - '(: -r -w -t -n -e -b -d)-L[list defined commands as calls]' \ - '(: -w -n -L -e -b -d)-r[read string from command]:name:->name:param: _vars:pattern:' \ - '(: -w -n -L -e -b -d)-t[test if output is available before reading]' \ - '(-r -w -t -n -L -d):zpty command name:' \ - '(-r -w -t -n -L -d):cmd: _command_names -e' \ - '(-r -w -t -n -L -d)*::args:_precommand' && return 0 - -# One could use sets, but that's more expensive and zpty is simple enough. -# -# _arguments -C -s -S \ -# - read \ -# '-r[read string from command]' \ -# '-t[test if output is available first]' \ -# ':name:->name' \ -# ':param: _vars' \ -# ':pattern:' \ -# - write \ -# '-w[send string to command]' \ -# '-n[do not add a newline to the result]' \ -# ':name:->name' \ -# '*:strings to write' \ -# - list \ -# '-L[list defined commands as calls]' \ -# - delete \ -# '-d[delete command]' \ -# '*:name:->name' \ -# - start \ -# '-e[echo input characters]' \ -# '-b[io to pseudo-terminal blocking]' \ -# ':zpty command name:' \ -# ':cmd: _command_names -e' \ -# '*::args:_precommand' && return 0 - - -if [[ $state = name ]]; then - if ! zmodload -e zsh/zpty; then - _message "zpty module not loaded" - return 1 - fi - list=( ${${(f)"$(zpty)"}#*\) } ) - names=( ${list%%:*} ) - if zstyle -T ":completion:${curcontext}:" verbose; then - zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- - zformat -a list " $sep" ${${(f)"$(zpty)"}#*\) } - _wanted names expl 'zpty command name' compadd -d list -a names - else - _wanted names expl 'zpty command name' compadd -a names - fi -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zsh-mime-handler b/zsh_arm64/system/usr/share/zsh/functions/_zsh-mime-handler deleted file mode 100644 index 000be2b..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zsh-mime-handler +++ /dev/null @@ -1,19 +0,0 @@ -#compdef zsh-mime-handler - -# Given that the handler is likely to change the start of the command -# line, we'll try to maintain the position from the end of the words -# array. Hence for example CURRENT gets decremented by one if the -# handler drops off the start. -integer end_offset=$(( ${#words} - CURRENT )) - -# zsh-mime-handler -l is supposed to print out the command line -# with quoting to turn it into a full executable line. So -# we need to use shell splitting to turn it into words and -# then unquoting on those words. -words=(${(z)"$(zsh-mime-handler -l "${(@)words[2,-1]}")"}) -# Careful unquoting: we need to keep a '' as a separate word. -words=("${(@Q)words}") - -(( CURRENT = ${#words} - end_offset )) - -_normal diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zsocket b/zsh_arm64/system/usr/share/zsh/functions/_zsocket deleted file mode 100644 index eeed9f1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zsocket +++ /dev/null @@ -1,14 +0,0 @@ -#compdef zsocket - -_arguments -s -w -A "-*" \ - '-v[verbose output]' \ - '-d[target file descriptor]:fd:_file_descriptors' \ - - outbound \ - '1: :_files' \ - - listen \ - '-l[open a socket listening]' \ - '1: :_files' \ - - accept \ - '-a[accept an incoming connection]' \ - '-t[return if no incoming connections are pending]' \ - '1:fd:{ (( words[(I)-*a*] )) && _file_descriptors }' diff --git a/zsh_arm64/system/usr/share/zsh/functions/_zstyle b/zsh_arm64/system/usr/share/zsh/functions/_zstyle deleted file mode 100644 index 7db73c0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_zstyle +++ /dev/null @@ -1,678 +0,0 @@ -#compdef zstyle - -local state context ostate line expl ctop suf -local nm=$compstate[nmatches] taglist patterns contexts MATCH -integer MBEGIN MEND -typeset -A opt_args styles - -_vcs_info_hooks() { - compadd - ${functions[(I)+vi-*]#+vi-} -} -# Assoc array of styles; the values give the possible top-level -# contexts: -# c completion -# d chpwd -# e line editor -# v vcs_info -# z zftp -# or any combination of the above, -# followed by a colon, followed by a state to enter, empty if none. -styles=( - accept-exact c:bool - accept-exact-dirs c:bool - add-space c:bool - ambiguous c:bool - assign-list c:_parameters - auto-description c: - avoid-completer c:completer - break-keys c: - cache-path c:_directories - cache-policy c:_functions - call-command c:bool - command c:command - command-path c:_dir_list - commands c: - complete c:bool - complete-options c:bool - completer c:completer - condition c:bool - cursor c:cursor - delimiters c: - disabled c:bool - domains c: - environ c:environ - expand c: - extra-verbose c:bool - fake c: - fake-always c: - fake-files c:fake-files - fake-parameters c:fake-params - file-list c:bool - file-patterns c:filepat - file-sort c:fsort - filter c: - force-list c: - format c: - glob c:bool - global c:bool - group-name c: - group-order c:tag - groups c:_groups - hidden c:bool - hosts c:_hosts - hosts-ports c:host-port - ignore-line c:ignline - ignore-parents c:ignorepar - ignored-patterns c: - insert-ids c:insert-ids - insert-tab c:bool - insert-unambiguous c:insunambig - keep-prefix c:keep-prefix - last-prompt c:bool - list ce:listwhen - list-colors c: - list-dirs-first c:bool - list-grouped c:bool - list-packed c:bool - list-prompt c: - list-rows-first c:bool - list-separator c:separator - list-suffixes c:bool - local c: - mail-directory c:_directories - match-original c:match-orig - matcher c: - matcher-list c: - max-errors c: - max-matches-width c:max-matches-width - menu c:boolauto - muttrc c:_files - numbers c:bool - old-list c:bool - old-matches c:oldmatches - old-menu c:bool - original c:bool - packageset c:packageset - path c:_directories - pager c:_command_names - path-completion c:bool - pine-directory c:_directories - ports c:_ports - prefix-hidden c:bool - prefix-needed c:bool - preserve-prefix c:preserve-prefix - range c: - recent-dirs-insert c:recent-dirs-insert - regular c:bool - rehash c:bool - remote-access c:bool - remove-all-dups c:bool - select-prompt c: - select-scroll c: - separate-sections c:bool - show-ambiguity c: - show-completer c:bool - single-ignored c:single-ignored - sort c:bool - special-dirs c:sdirs - squeeze-slashes c:bool - stop c:stop - strip-comments c:bool - subst-globs-only c:bool - substitute c:bool - suffix c:bool - tag-order c:tag-order - try-to-use-pminst c:bool - urls c:_urls - use-cache c:bool - use-compctl c:urgh - use-ip c:bool - use-perl c:bool - users c:_users - users-hosts c:user-host - users-hosts-ports c:user-host-port - verbose ce:bool - word c:bool - - recent-dirs-default d:bool - recent-dirs-file d:_files - recent-dirs-max d: - recent-dirs-prune d: - recent-dirs-pushd d:bool - - auto-previous e:bool - break-keys e: - cursor e: - edit-buffer e:bool - edit-previous e:bool - insert-kept e: - leave-cursor e:bool - match e: - prompt e: - stop-keys e: - toggle e:bool - url-globbers e: - url-local-schema e: - url-metas e: - url-other-schema e: - url-seps e: - whence e: - word-chars e: - word-class e: - word-style e:word-style - word-context e: - - formats v:vcs-format - actionformats v:vcs-format - branchformat v:branch-format - nvcsformats v: - hgrevformat v:hgrev-format - stgitformat v:stg-format - patch-format v:patch-format - nopatch-format v:patch-format - max-exports v: - enable v:vcs - disable v:vcs - disable-patterns v: - check-for-changes v:bool - check-for-staged-changes - v:bool - stagedstr v: - unstagedstr v: - command v:_command_names - use-server v:bool - use-simple v:bool - get-revision v:bool - get-mq v:bool - get-bookmarks v:bool - get-unapplied v:bool - debug v:bool - hooks v:_vcs_info_hooks - use-prompt-escapes v:bool - use-quilt v:bool - quilt-standalone v:bool - quilt-patch-dir v:_directories - quiltcommand v:_command_names - - chpwd z:bool - progress z:progress - remote-glob z:bool - titlebar z:bool - update z: -) - -taglist=( - accounts all-expansions all-files arguments arrays association-keys - bookmarks builtins characters colormapids colors commands contexts - corrections cursors default descriptions devices directories - directory-stack displays expansions extensions files flags fstypes - fonts functions globbed-files groups history-words hosts indexes - interfaces jobs keymaps keysyms libraries limits local-directories - mailboxes manuals maps messages modifiers modules my-accounts - named-directories names newsgroups nicknames options original - other-accounts packages parameters path-directories paths pods ports - prefixes printers processes processes-names ps regex sequences - sessions signals strings styles tags targets timezones types urls - users values variant visuals warnings widgets windows zsh-options - email-address ${(k)functions[(I)_email-*]#_} -) - -# Be careful with the context arguments here. They like to masquerade. -_arguments -C \ - '(: -)-L[output in form of zstyle commands]:pattern for context patterns:->metapatterns:style:->metastyles' \ - '(: -)-d[delete style definitions]:verbatim context pattern:->patterns:*:styles:->pstyles' \ - '(: -)-e[value is evaluated when style is looked up]:context pattern:->contexts:style:->styles:*:command:_cmdstring' \ - '(: -)-g[retrieve style definition]:array parameter:_parameters -g "*array*":verbatim context pattern:->patterns:styles:->pstyles' \ - '(: -)-s[retrieve style value as string]:context name:->contexts:style:->styles:scalar parameter:_parameters -g "*scalar*":separator: ' \ - '(: -)-b[retrieve style value as boolean]:context name:->contexts:style:->styles:scalar parameter:_parameters -g "*scalar*"' \ - '(: -)-a[retrieve style value as array]:context name:->contexts:style:->styles:array parameter:_parameters -g "*array*"' \ - '(: -)-t[test a style, returning false if it'\''s undefined]:context name:->contexts:style:->styles:*:strings to test presence of: ' \ - '(: -)-T[test a style, returning true if it'\''s undefined]:context name:->contexts:style:->styles:*:strings to test presence of: ' \ - '(: -)-m[pattern-match values of a style]:context name:->contexts:style:->styles:pattern: ' \ - '(-):context pattern:->contexts' '(-):style:->styles' '(-)*:argument:->style-arg' - -while (( $#state )); do - case "$state[1]" in - # 'contexts' completes either full context names (for -t/-s/-a), or context - # patterns (for 'zstyle :foo bar' and -e). - (contexts) - if [[ ! -prefix :*: ]]; then - _wanted contexts expl "$state_descr" compadd -P : -qS : chpwd completion vcs_info zftp zle - elif compset -P :completion:; then - contexts=( functions _completers cmdorcont argument tag ) - elif compset -P :vcs_info:; then - contexts=( vcs-string user-context repo-root-name ) - elif compset -P :zle:; then - _wanted widgets expl widget _widgets -qS : - fi - if (( $#contexts )); then - for ostate in $contexts; do - compset -P '[^:]#:' || break - done - suf=() - compset -S ':*' || suf=( -qS: ) - [[ $ostate = $contexts[-1] ]] && suf=() - if compset -P '(|\\)\((*\||)'; then # handle (x|y) patterns - suf=() - compset -S '(|\\)[)|]*' || - suf=( -S "${${QIPREFIX:+|}:-\|}" -r "${${QIPREFIX:+|}:-\\\\} \t)" ) - fi - state+=( "$ostate" ) - fi - ;; - - # 'patterns' completes context patterns that are set, for -d/-g. - (patterns) - zstyle -g patterns - _wanted contexts expl "$state_descr" compadd -a patterns - ;; - - # 'metapatterns': patterns that are matched not against contexts, but - # against patterns. - (metapatterns) - zstyle -g patterns - patterns=( "${(@b)patterns}" ) - _wanted contexts expl "$state_descr" compadd -a patterns - ;; - - # 'metastyles': styles that are set on context patterns matching the given - # metapattern. - (metastyles) - # Anonymous function to shadow the global $styles assoc - () { - local metapattern=${(Q)${${opt_args[-L]%:*}//(#m)\\([\\:])/${MATCH[2]}}} - local -a metastyles styles - local pattern - zstyle -g patterns - for pattern in "${(@M)patterns:#${~metapattern}}"; do - zstyle -g styles $pattern - metastyles+=( "${styles[@]}" ) - done - _wanted styles expl "$state_descr" compadd -a metastyles - unset pattern - unset metastyles - } - ;; - - # 'pstyles': complete styles that are set for the verbatim context pattern - # specified on the command line. (If the user has set no zstyles, this - # will complete nothing.) - (pstyles) - local -a pstyles - local pattern - if (( $+opt_args[-d] )); then - pattern=${opt_args[-d]} - pattern=${pattern%":${(b)PREFIX}"} # remove style - pattern=${pattern//(#m)\\([\\:])/${MATCH[2]}} # undo _arguments escaping - pattern=${(Q)pattern} # undo command-line escaping (assumes no noglob) - zstyle -g pstyles $pattern - elif (( $+opt_args[-g] )); then - pattern=${opt_args[-g]} - pattern=${pattern%":${(b)PREFIX}"} # remove style - pattern=${pattern#*:} # remove array name - pattern=${pattern//(#m)\\([\\:])/${MATCH[2]}} # undo _arguments escaping - pattern=${(Q)pattern} # undo command-line escaping (assumes no noglob) - zstyle -g pstyles $pattern - fi - _wanted styles expl style compadd -a pstyles - unset pattern - unset pstyles - ;; - - # 'styles': complete all styles that may be set in the context given on the - # command line. This is independent of what styles are set. - (styles) - # Get the top-level context we're completing for, if any. - if [[ -n $line[1] ]]; then - # zstyle :something - local the_context=$line[1] - else - # zstyle -x :something - local joined_value=${(v)opt_args[(i)(-e|-s|-b|-a|-t|-T|-m)]} - local the_context=${(Q)joined_value[0, ${joined_value[(i)[^\\]:]}-2 ]} - fi - # Note: for 'zstyle :something ' and for 'zstyle -e :something ', - # $the_context is a context pattern; for -s,-b,-a,-t,-T,-m, it is a context - # name. We currently draw no distinction between these two cases. - case $the_context in - (:completion:*) - ctop=c - ;; - - (:chwpd:*) - ctop=d - ;; - - (:zftp:*) - ctop=z - ;; - - (:vcs_info:*) - ctop=v - ;; - - (:zle:*) - ctop=e - ;; - - (*) - ctop=a-z - ;; - esac - _wanted styles expl style \ - compadd -M 'r:|-=* r:|=*' -k "styles[(R)[^:]#[$ctop][^:]#:*]" - ;; - - (style-arg) - state+=( "${styles[${(Q)line[2]}]#*:}" ) - ;; - - (argument) - _message -e arguments argument - ;; - - (bool) - _wanted values expl boolean compadd true false - ;; - - (boolauto) - _wanted values expl boolean \ - compadd true false auto select search search-backward interactive - ;; - - (cmdorcont) - _alternative -O suf \ - 'commands:command:_path_commands' \ - 'contexts:context:(-array-value- -brace-parameter- -command- -condition- -math- -parameter- -redirect- -subscript- -value-)' - ;; - - (cursor) - _wanted values expl 'cursor positioning' compadd complete key default - ;; - - (completer) - _wanted values expl completer _completers -p - ;; - - (environ) - if [[ "$PREFIX" = *\=* ]]; then - compstate[parameter]="${PREFIX%%\=*}" - compset -P 1 '*=' - _value - else - suf=() - compset -S '=*' || suf=(-S '=') - _parameters -q $suf - fi - ;; - - (fsort) - _wanted values expl 'how to sort files' \ - compadd name size links time date modification access inode change reverse - ;; - - (function) - _wanted control-function expl 'control function' \ - compadd predict-on all-matches - ;; - - (functions) - _wanted comp-widget expl 'completion widget' \ - compadd $suf - all-matches complete-debug complete-tag \ - correct-word expand-word expand-alias-word history-words - ;; - - (user-host-port) - if [[ $PREFIX != *[@:]* ]]; then - _users -S @ - elif [[ $PREFIX = *[@:]*[[@:]* ]]; then - compset -P 2 '*[:@]' - _ports - else - compset -P 1 '*[:@]' - _hosts -S : - fi - ;; - - (host-port) - if [[ $PREFIX != *:* ]]; then - _hosts -S : - else - compset -P 1 '*:' - _ports - fi - ;; - - (listwhen) - _wanted values expl 'when to list completions' \ - compadd always never sometimes - ;; - - (packageset) - _wanted values expl 'default package set' \ - compadd available installed uninstalled - ;; - - (progress) - _wanted values expl 'progress meter style' \ - compadd none bar percent - ;; - - (sdirs) - _wanted values expl 'whether to complete . or ..' \ - compadd true false .. - ;; - - (stop) - _wanted values expl 'when to insert matches' \ - compadd true false verbose - ;; - - (tag) - _wanted tags expl tag compadd $suf -a taglist - ;; - - (tag-order) - if compset -P '*:*:'; then - _message -e descriptions description - elif compset -P '*:'; then - _message -e labels 'tag label' - else - suf=() - compset -S ':*' || suf=( -qS: ) - _wanted values expl tag compadd $suf -a taglist - fi - ;; - - (filepat) - if compset -P '*:*:'; then - _message -e descriptions description - elif compset -P '*:'; then - _message -e tags tag - else - _message -e patterns 'glob patterns' - fi - ;; - - (user-host) - if [[ $PREFIX = *[@:]* ]]; then - compset -P '*[@:]' - _hosts - else - _users -S @ - fi - ;; - - (ignorepar) - _wanted values expl 'which parents to ignore' \ - compadd parent pwd .. directory - ;; - - (single-ignored) - _wanted values expl 'how to handle a single ignored match' \ - compadd - show menu - ;; - - (command) - shift 3 words - (( CURRENT -= 3 )) - _normal - ;; - - (insert-ids) - _wanted values expl 'when to insert process IDs' \ - compadd - menu single longer - ;; - - (fake-files) - _message -e fakes 'prefix and names' - ;; - - (fake-params) - if compset -P '*:'; then - _wanted values expl 'parameter type' compadd scalar array integer - else - suf='' - compset -S ':*' || suf='-qS:' - _wanted values expl 'fake parameter' _parameters $suf - fi - ;; - - (ignline) - _wanted values expl 'ignore strings on the line' compadd true false current current-shown other - ;; - - (keep-prefix) - _wanted values expl 'keep prefix' compadd true false changed - ;; - - (match-orig) - _wanted values expl "match without inserting \`*'" compadd only both - ;; - - (oldmatches) - _wanted values expl 'use list of old matches' compadd true false only - ;; - - (insunambig) - _wanted values expl 'insert unambiguous string' compadd true false pattern - ;; - - (preserve-prefix) - _message -e prefixes 'pattern matching prefix to keep' - ;; - - (recent-dirs-insert) - _wanted values expl 'inserting recent directories' \ - compadd true false always fallback both - ;; - - (separator) - _message -e separators 'separator string' - ;; - - (max-matches-width) - _message -e numbers 'maximum display width for matches' - ;; - - (urgh) - _wanted values expl no compadd no false off 0 - ;; - - (word-style) - _wanted word-styles expl 'word style' compadd {normal,specified,unspecified,shell,whitespace}-subword - ;; - - (vcs-string) - _wanted vcs expl vcs compadd $suf - \ - ${${(f)"$(_call_program vcs vcs_info_printsys 2>/dev/null)"}:#\#*} - ;; - - (vcs) - _wanted vcs expl vcs compadd \ - ${${(f)"$(_call_program vcs vcs_info_printsys 2>/dev/null)"}:#(\#|*-)*} - ;; - - (user-context) - _wanted user-contexts expl 'user context' compadd $suf default command - ;; - - (repo-root-name) - _message -e names 'repository root name' - ;; - - (vcs-format) - if [[ $PREFIX = *% ]]; then - compset -P '*%' - _values -s '' 'format replacement' \ - 's[the vcs in use]' \ - 'b[the current branch]' \ - 'a[an identifier describing the action]' \ - 'i[current revision no/id]' \ - 'c[details of staged changes]' \ - 'u[details of unstaged changes]' \ - 'r[repository name]' \ - 'S[subdirectory within repository]' \ - 'm[misc replacement - backend specific]' - else - _message -e formats 'vcs format' - fi - ;; - - (branch-format) - if [[ $PREFIX = *% ]]; then - compset -P '*%' - _values -s '' 'format replacement' \ - 'b[the current branch]' \ - 'r[current revision number]' - else - _message -e formats 'vcs format' - fi - ;; - - (hgrev-format) - if [[ $PREFIX = *% ]]; then - compset -P '*%' - _values -s '' 'format replacement' \ - 'h[current revision hash (global)]' \ - 'r[current revision number (local)]' - else - _message -e formats 'vcs format' - fi - ;; - - (stg-format) - if [[ $PREFIX = *% ]]; then - compset -P '*%' - _values -s '' 'format replacement' \ - 'p[patch currently on top of the stack]' \ - 'c[the number of unapplied patches]' - else - _message -e formats 'vcs format' - fi - ;; - - (patch-format) - if [[ $PREFIX = *% ]]; then - compset -P '*%' - _values -s '' 'format replacement' \ - 'p[name of top-most patch (applied-string)]' \ - 'u[number of unapplied patches (unapplied-string)]' \ - 'n[number of applied patches]' \ - 'c[number of unapplied patches.]' \ - 'a[number of all patches]' \ - 'g[names of active mq guards (hg backend)]' \ - 'G[number of active mq guards (hg backend)]' - else - _message -e formats 'vcs format' - fi - ;; - - (_*) - ${=state[1]} $suf - ;; - esac - shift state -done - -[[ $compstate[nmatches] != $nm ]] diff --git a/zsh_arm64/system/usr/share/zsh/functions/_ztodo b/zsh_arm64/system/usr/share/zsh/functions/_ztodo deleted file mode 100644 index 73be91e..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/_ztodo +++ /dev/null @@ -1,30 +0,0 @@ -#compdef ztodo - -_ztodo_entries() { - local -a entries - - entries=(${${${${(f)"$(_call_program ztodo-entry ztodo list)"}#[[:space:]]##}/:[[:space:]]##/:}%:[[:space:]]#}) - _describe -t ztodo-entry 'todo entry' entries "$@" -} - -local -a args reply -args=( - /$'[^\0]#\0'/ -) - -local -a todo_entry -todo_entry=( - /$'[^\0]#\0'/ ':ztodo-entry:todo entry:_ztodo_entries' -) - -_regex_words \ - commands "ztodo command" \ - 'add:add entry' \ - 'del:delete entry:$todo_entry' \ - 'clear:clear todo list' \ - 'list:show todo list' -args+=("$reply[@]") - -_regex_arguments _ztodo "${args[@]}" - -_ztodo "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/add-zle-hook-widget b/zsh_arm64/system/usr/share/zsh/functions/add-zle-hook-widget deleted file mode 100644 index 9cc3549..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/add-zle-hook-widget +++ /dev/null @@ -1,186 +0,0 @@ -# Add to HOOK the given WIDGET -# -# HOOK is one of isearch-exit, isearch-update, line-pre-redraw, line-init, -# line-finish, history-line-set, keymap-select (the zle- prefix is allowed -# but not required). If a widget corresponding to HOOK already exists, it -# is preserved and called first in the new set of HOOK widgets. -# -# With -d, remove the WIDGET from the hook instead; deletes the hook -# linkage if it is empty. -# -# -D behaves like -d, but pattern characters are active in WIDGET, so -# any matching widget will be deleted from the hook. -# -# Without -d, if the WIDGET is not already defined, a function having the -# same name is marked for autoload; -U is passed down to autoload if that -# is given, as are -z and -k. (This is harmless if the function is -# already defined.) The WIDGET is then created with zle -N. -# -# The -L option lists the hooks and their associated widgets. - -# This is probably more safeguarding than necessary -zmodload -e zsh/zle || return 1 -{ zmodload zsh/parameter && zmodload zsh/zleparameter } || { - print -u2 "add-zle-hook-widget: Need parameter modules for zle hooks" - return 1 -} - -() { # Preserve caller global option settings - -emulate -L zsh - -# Setup - create the base functions for hook widgets that call the others - -local -a hooktypes=( zle-isearch-exit zle-isearch-update - zle-line-pre-redraw zle-line-init zle-line-finish - zle-history-line-set zle-keymap-select ) -# Stash in zstyle to make it global -zstyle zle-hook types ${hooktypes#zle-} - -# Relying on multifuncdef option here -function azhw:${^hooktypes} { - local -a hook_widgets - local hook - # Values of these styles look like number:name - # and we run them in number order - zstyle -a $WIDGET widgets hook_widgets - for hook in "${(@)${(@on)hook_widgets[@]}#<->:}"; do - if [[ "$hook" = user:* ]]; then - # Preserve $WIDGET within the renamed widget - zle "$hook" -N -- "$@" - else - zle "$hook" -Nw -- "$@" - fi || return - done - return 0 -} - -# Redefine ourself with the setup left out - -function add-zle-hook-widget { - local -a hooktypes - zstyle -a zle-hook types hooktypes - - # This part copied from add-zsh-hook - local usage="Usage: $funcstack[1] hook widgetname\nValid hooks are:\n $hooktypes" - - local opt - local -a autoopts - integer del list help - - while getopts "dDhLUzk" opt; do - case $opt in - (d) - del=1 - ;; - - (D) - del=2 - ;; - - (h) - help=1 - ;; - - (L) - list=1 - ;; - - ([Uzk]) - autoopts+=(-$opt) - ;; - - (*) - return 1 - ;; - esac - done - shift $(( OPTIND - 1 )) - - 1=${1#zle-} # Strip prefix not stored in zle-hook types style - - if (( list )); then - zstyle -L "zle-(${1:-${(@j:|:)hooktypes[@]}})" widgets - return $? - elif (( help || $# != 2 || ${hooktypes[(I)$1]} == 0 )); then - print -u$(( 2 - help )) $usage - return $(( 1 - help )) - fi - - local -aU extant_hooks - local hook="zle-$1" - local fn="$2" - - if (( del )); then - # delete, if hook is set - if zstyle -g extant_hooks "$hook" widgets; then - if (( del == 2 )); then - set -A extant_hooks ${extant_hooks[@]:#(<->:|)${~fn}} - else - set -A extant_hooks ${extant_hooks[@]:#(<->:|)$fn} - fi - # unset if no remaining entries - if (( ${#extant_hooks} )); then - zstyle "$hook" widgets "${extant_hooks[@]}" - else - zstyle -d "$hook" widgets - fi - fi - else - # Check whether attempting to add a widget named for the hook - if [[ "$fn" = "$hook" ]]; then - if (( ${+widgets[$fn]} )); then - print -u2 "$funcstack[1]: Cannot hook $fn to itself" - return 1 - fi - # No point in building the array until another is added - autoload "${autoopts[@]}" -- "$fn" - zle -N "$fn" - return 0 - fi - integer i=${#options[ksharrays]}-2 - zstyle -g extant_hooks "$hook" widgets - # Check for an existing widget, add it as the first hook - if [[ ${widgets[$hook]:-} != "user:azhw:$hook" ]]; then - if [[ -n ${widgets[$hook]:-} ]]; then - zle -A "$hook" "${widgets[$hook]}" - extant_hooks=(0:"${widgets[$hook]}" "${extant_hooks[@]}") - fi - zle -N "$hook" azhw:"$hook" - fi - # Add new widget only if not already in the hook list - if [[ -z ${(M)extant_hooks[@]:#(<->:|)$fn} ]]; then - # no index and not already hooked - # assign largest existing index plus 1 - i=${${(On@)${(@M)extant_hooks[@]#<->:}%:}[i]:-0}+1 - else - return 0 - fi - extant_hooks+=("${i}:${fn}") - zstyle -- "$hook" widgets "${extant_hooks[@]}" - if (( ! ${+widgets[$fn]} )); then - autoload "${autoopts[@]}" -- "$fn" - zle -N -- "$fn" - fi - if (( ! ${+widgets[$hook]} )); then - zle -N "$hook" azhw:"$hook" - fi - fi -} - -} "$@" # Resume caller global options - -# Handle zsh autoloading conventions: -# - "file" appears last in zsh_eval_context when "source"-ing -# - "evalautofunc" appears with kshautoload set or autoload -k -# - "loadautofunc" appears with kshautoload unset or autoload -z -# - use of autoload +X cannot reliably be detected, use best guess -case "$zsh_eval_context" in -*file) ;; -*evalautofunc) ;; -*loadautofunc) add-zle-hook-widget "$@";; -*) [[ -o kshautoload ]] || add-zle-hook-widget "$@";; -esac -# Note fallback here is equivalent to the usual best-guess used by -# functions written for zsh before $zsh_eval_context was available -# so this case-statement is backward-compatible. diff --git a/zsh_arm64/system/usr/share/zsh/functions/add-zsh-hook b/zsh_arm64/system/usr/share/zsh/functions/add-zsh-hook deleted file mode 100644 index 3bc952e..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/add-zsh-hook +++ /dev/null @@ -1,93 +0,0 @@ -# Add to HOOK the given FUNCTION. -# HOOK is one of chpwd, precmd, preexec, periodic, zshaddhistory, -# zshexit, zsh_directory_name (the _functions subscript is not required). -# -# With -d, remove the function from the hook instead; delete the hook -# variable if it is empty. -# -# -D behaves like -d, but pattern characters are active in the -# function name, so any matching function will be deleted from the hook. -# -# Without -d, the FUNCTION is marked for autoload; -U is passed down to -# autoload if that is given, as are -z and -k. (This is harmless if the -# function is actually defined inline.) - -emulate -L zsh - -local -a hooktypes -hooktypes=( - chpwd precmd preexec periodic zshaddhistory zshexit - zsh_directory_name -) -local usage="Usage: add-zsh-hook hook function\nValid hooks are:\n $hooktypes" - -local opt -local -a autoopts -integer del list help - -while getopts "dDhLUzk" opt; do - case $opt in - (d) - del=1 - ;; - - (D) - del=2 - ;; - - (h) - help=1 - ;; - - (L) - list=1 - ;; - - ([Uzk]) - autoopts+=(-$opt) - ;; - - (*) - return 1 - ;; - esac -done -shift $(( OPTIND - 1 )) - -if (( list )); then - typeset -mp "(${1:-${(@j:|:)hooktypes}})_functions" - return $? -elif (( help || $# != 2 || ${hooktypes[(I)$1]} == 0 )); then - print -u$(( 2 - help )) $usage - return $(( 1 - help )) -fi - -local hook="${1}_functions" -local fn="$2" - -if (( del )); then - # delete, if hook is set - if (( ${(P)+hook} )); then - if (( del == 2 )); then - set -A $hook ${(P)hook:#${~fn}} - else - set -A $hook ${(P)hook:#$fn} - fi - # unset if no remaining entries --- this can give better - # performance in some cases - if (( ! ${(P)#hook} )); then - unset $hook - fi - fi -else - if (( ${(P)+hook} )); then - if (( ${${(P)hook}[(I)$fn]} == 0 )); then - typeset -ga $hook - set -A $hook ${(P)hook} $fn - fi - else - typeset -ga $hook - set -A $hook $fn - fi - autoload $autoopts -- $fn -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/after b/zsh_arm64/system/usr/share/zsh/functions/after deleted file mode 100644 index 7fb0166..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/after +++ /dev/null @@ -1,67 +0,0 @@ -# Glob qualifier function, e.g -# -# print *(e:after 2014/08/01:) -# print *(e-after today:12:00-) -# -# If named before: -# Match files modified before a given time. -# -# If named after: -# Match files modified after a given time. Use as glob qualifier. -# N.B.: "after" actually includes the given time as it is to second -# precision (it would be inconvenient to exclude the first second of a date). -# It should therefore more logically be called "from", but that's a less -# obvious name. -# -# File to test is in $REPLY. -# -# Similar to age, but only takes at most one data, which is -# compared directly with the current time. - -emulate -L zsh - -zmodload -F zsh/stat b:zstat -zmodload -i zsh/parameter - -autoload -Uz calendar_scandate - -local timefmt -local -a vals tmp - -[[ -e $REPLY ]] || return 1 -zstat -A vals +mtime -- $REPLY || return 1 - -if (( $# == 1 )); then - if [[ $1 = :* ]]; then - timefmt="%Y/%m/%d:%H:%M:%S" - zstat -A tmp -F $timefmt +mtime -- ${1#:} || return 1 - local AGEREF=$tmp[1] - else - local AGEREF=$1 - fi -fi - -integer mtime=$vals[1] date1 date2 -local REPLY REPLY2 - -# allow a time only (meaning today) -if calendar_scandate -t $AGEREF; then - date1=$REPLY - - case $0 in - (after) - (( mtime >= date1 )) - ;; - - (before) - (( mtime < date1 )) - ;; - - (*) - print "$0: must be named 'after' or 'before'" >&2 - return 1 - ;; - esac -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/age b/zsh_arm64/system/usr/share/zsh/functions/age deleted file mode 100644 index 50755d6..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/age +++ /dev/null @@ -1,85 +0,0 @@ -# Match the age of a file, for use as a glob qualifier. Can -# take one or two arguments, which can be supplied by one of two -# ways (always the same for both arguments): -# -# print *(e:age 2006/10/04 2006/10/09:) -# -# Match all files modified between the start of those dates. -# -# print *(e:age 2006/10/04:) -# -# Match all files modified on that date. If the second argument is -# omitted it is taken to be exactly 24 hours after the first argument -# (even if the first argument contains a time). -# -# print *(e-age 2006/10/04:10:15 2006/10/04:10:45-) -# -# Supply times. All the time and formats handled by calendar_scandate -# are allowed, but whitespace must be quoted to ensure age receives -# the correct arguments. -# -# AGEREF=2006/10/04:10:15 -# AGEREF2=2006/10/04:10:45 -# print *(+age) -# -# The same example using the other form of argument passing. The -# dates stay in effect until unset, but will be overridden if -# any argument is passed in the first format. - -emulate -L zsh - -zmodload -F zsh/stat b:zstat -zmodload -i zsh/parameter - -autoload -Uz calendar_scandate - -local timefmt -local -a vals tmp - -[[ -e $REPLY ]] || return 1 -zstat -A vals +mtime -- $REPLY || return 1 - -if (( $# >= 1 )); then - if [[ $1 = :* ]]; then - if (( $# > 1 )); then - timefmt="%Y/%m/%d:%H:%M:%S" - else - timefmt="%Y/%m/%d" - fi - zstat -A tmp -F $timefmt +mtime -- ${1#:} || return 1 - local AGEREF=$tmp[1] - else - local AGEREF=$1 - fi - # if 1 argument given, never use globally defined AGEREF2 - if [[ $2 = :* ]]; then - zstat -A tmp -F "%Y/%m/%d:%H:%M:%S" +mtime -- ${2#:} || return 1 - local AGEREF2=$tmp[1] - else - local AGEREF2=$2 - fi -fi - -integer mtime=$vals[1] date1 date2 -local REPLY REPLY2 - -# allow a time only (meaning today) -if calendar_scandate -t $AGEREF; then - date1=$REPLY - - if [[ -n $AGEREF2 ]]; then - if [[ $AGEREF2 = +* ]]; then - calendar_scandate -rt $AGEREF2[2,-1] || return 1 - (( date2 = date1 + REPLY )) - else - calendar_scandate -t $AGEREF2 || return 1 - date2=$REPLY - fi - else - (( date2 = date1 + 24 * 60 * 60 )) - fi - - (( date1 <= mtime && mtime <= date2 )) -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/allopt b/zsh_arm64/system/usr/share/zsh/functions/allopt deleted file mode 100644 index 5d5d288..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/allopt +++ /dev/null @@ -1,25 +0,0 @@ -# This function lists options with the no's in front removed for -# improved comprehension, i.e. `norcs off' becomes `rcs on'. -# The format is otherwise like that with `kshoptionprint' set, -# i.e. you can see all options whether on or off. -# It can take a list of option names or parts thereof to search for -# via egrep. -# -# Written by Sweth Chandramouli with hacks by Bart Schaefer. - -listalloptions () { - local OPT_NAME OPT_VALUE IFS=$' \t\n' - builtin set -o | while read OPT_NAME OPT_VALUE ; do - if [[ ${OPT_NAME#no} != ${OPT_NAME} ]] ; then - OPT_VALUE=${(L)${${OPT_VALUE:s/on/OFF}:s/off/on}} - OPT_NAME=${OPT_NAME#no} - fi - echo "${(r:21:)OPT_NAME} ${OPT_VALUE}" - done -} - -if [[ -n $@ ]]; then - listalloptions | egrep "${(j.|.)@}" -else - listalloptions -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/backward-kill-word-match b/zsh_arm64/system/usr/share/zsh/functions/backward-kill-word-match deleted file mode 100644 index f04614c..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/backward-kill-word-match +++ /dev/null @@ -1,37 +0,0 @@ -emulate -L zsh -setopt extendedglob - -autoload match-words-by-style - -local curcontext=":zle:$WIDGET" word done -local -a matched_words -integer count=${NUMERIC:-1} - -if (( count < 0 )); then - (( NUMERIC = -count )) - zle ${WIDGET##backward-} - return -fi - -while (( count-- )); do - - match-words-by-style - - word="$matched_words[2]$matched_words[3]" - - if [[ -n $word ]]; then - if [[ -n $done || $LASTWIDGET = *kill* ]]; then - CUTBUFFER="$word$CUTBUFFER" - else - zle copy-region-as-kill -- "$word" - fi - LBUFFER=$matched_words[1] - else - return 1 - fi - done=1 -done - -zle -f 'kill' - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/backward-word-match b/zsh_arm64/system/usr/share/zsh/functions/backward-word-match deleted file mode 100644 index bda10d1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/backward-word-match +++ /dev/null @@ -1,29 +0,0 @@ -emulate -L zsh -setopt extendedglob - -autoload match-words-by-style - -local curcontext=":zle:$WIDGET" word -local -a matched_words -integer count=${NUMERIC:-1} - -if (( count < 0 )); then - (( NUMERIC = - count )) - zle ${WIDGET/backward/forward} - return -fi - -while (( count-- )); do - - match-words-by-style - - word=$matched_words[2]$matched_words[3] - - if [[ -n $word ]]; then - (( CURSOR -= ${#word} )) - else - return 1 - fi -done - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/bashcompinit b/zsh_arm64/system/usr/share/zsh/functions/bashcompinit deleted file mode 100644 index 02290a1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/bashcompinit +++ /dev/null @@ -1,179 +0,0 @@ -#autoload - -_bash_complete() { - local ret=1 - local -a suf matches - local -x COMP_POINT COMP_CWORD - local -a COMP_WORDS COMPREPLY BASH_VERSINFO - local -x COMP_LINE="$words" - local -A savejobstates savejobtexts - - (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT-1]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX )) - (( COMP_CWORD = CURRENT - 1)) - COMP_WORDS=( $words ) - BASH_VERSINFO=( 2 05b 0 1 release ) - - savejobstates=( ${(kv)jobstates} ) - savejobtexts=( ${(kv)jobtexts} ) - - [[ ${argv[${argv[(I)nospace]:-0}-1]} = -o ]] && suf=( -S '' ) - - matches=( ${(f)"$(compgen $@ -- ${words[CURRENT]})"} ) - - if [[ -n $matches ]]; then - if [[ ${argv[${argv[(I)filenames]:-0}-1]} = -o ]]; then - compset -P '*/' && matches=( ${matches##*/} ) - compset -S '/*' && matches=( ${matches%%/*} ) - compadd -Q -f "${suf[@]}" -a matches && ret=0 - else - compadd -Q "${suf[@]}" -a matches && ret=0 - fi - fi - - if (( ret )); then - if [[ ${argv[${argv[(I)default]:-0}-1]} = -o ]]; then - _default "${suf[@]}" && ret=0 - elif [[ ${argv[${argv[(I)dirnames]:-0}-1]} = -o ]]; then - _directories "${suf[@]}" && ret=0 - fi - fi - - return ret -} - -compgen() { - local opts prefix suffix job OPTARG OPTIND ret=1 - local -a name res results jids - local -A shortopts - - # words changes behavior: words[1] -> words[0] - emulate -L sh - setopt kshglob noshglob braceexpand nokshautoload - - shortopts=( - a alias b builtin c command d directory e export f file - g group j job k keyword u user v variable - ) - - while getopts "o:A:G:C:F:P:S:W:X:abcdefgjkuv" name; do - case $name in - [abcdefgjkuv]) OPTARG="${shortopts[$name]}" ;& - A) - case $OPTARG in - alias) results+=( "${(k)aliases[@]}" ) ;; - arrayvar) results+=( "${(k@)parameters[(R)array*]}" ) ;; - binding) results+=( "${(k)widgets[@]}" ) ;; - builtin) results+=( "${(k)builtins[@]}" "${(k)dis_builtins[@]}" ) ;; - command) - results+=( - "${(k)commands[@]}" "${(k)aliases[@]}" "${(k)builtins[@]}" - "${(k)functions[@]}" "${(k)reswords[@]}" - ) - ;; - directory) - setopt bareglobqual - results+=( ${IPREFIX}${PREFIX}*${SUFFIX}${ISUFFIX}(N-/) ) - setopt nobareglobqual - ;; - disabled) results+=( "${(k)dis_builtins[@]}" ) ;; - enabled) results+=( "${(k)builtins[@]}" ) ;; - export) results+=( "${(k)parameters[(R)*export*]}" ) ;; - file) - setopt bareglobqual - results+=( ${IPREFIX}${PREFIX}*${SUFFIX}${ISUFFIX}(N) ) - setopt nobareglobqual - ;; - function) results+=( "${(k)functions[@]}" ) ;; - group) - emulate zsh - _groups -U -O res - emulate sh - setopt kshglob noshglob braceexpand - results+=( "${res[@]}" ) - ;; - hostname) - emulate zsh - _hosts -U -O res - emulate sh - setopt kshglob noshglob braceexpand - results+=( "${res[@]}" ) - ;; - job) results+=( "${savejobtexts[@]%% *}" );; - keyword) results+=( "${(k)reswords[@]}" ) ;; - running) - jids=( "${(@k)savejobstates[(R)running*]}" ) - for job in "${jids[@]}"; do - results+=( ${savejobtexts[$job]%% *} ) - done - ;; - stopped) - jids=( "${(@k)savejobstates[(R)suspended*]}" ) - for job in "${jids[@]}"; do - results+=( ${savejobtexts[$job]%% *} ) - done - ;; - setopt|shopt) results+=( "${(k)options[@]}" ) ;; - signal) results+=( "SIG${^signals[@]}" ) ;; - user) results+=( "${(k)userdirs[@]}" ) ;; - variable) results+=( "${(k)parameters[@]}" ) ;; - helptopic) ;; - esac - ;; - F) - COMPREPLY=() - local -a args - args=( "${words[0]}" "${@[-1]}" "${words[CURRENT-2]}" ) - (){ - # There may be more things we need to add to this typeset to - # protect bash functions from compsys special variable names - typeset -h words - $OPTARG "${args[@]}" - } - results+=( "${COMPREPLY[@]}" ) - ;; - G) - setopt nullglob - results+=( ${~OPTARG} ) - unsetopt nullglob - ;; - W) results+=( ${(Q)~=OPTARG} ) ;; - C) results+=( $(eval $OPTARG) ) ;; - P) prefix="$OPTARG" ;; - S) suffix="$OPTARG" ;; - X) - if [[ ${OPTARG[0]} = '!' ]]; then - results=( "${(M)results[@]:#${OPTARG#?}}" ) - else - results=( "${results[@]:#$OPTARG}" ) - fi - ;; - esac - done - - # support for the last, `word' option to compgen. Zsh's matching does a - # better job but if you need to, comment this in and use compadd -U - # (( $# >= OPTIND)) && results=( "${(M)results[@]:#${@[-1]}*}" ) - - print -l -r -- "$prefix${^results[@]}$suffix" -} - -complete() { - emulate -L zsh - local args void cmd print remove - args=( "$@" ) - zparseopts -D -a void o: A: G: W: C: F: P: S: X: a b c d e f g j k u v \ - p=print r=remove - if [[ -n $print ]]; then - printf 'complete %2$s %1$s\n' "${(@kv)_comps[(R)_bash*]#* }" - elif [[ -n $remove ]]; then - for cmd; do - unset "_comps[$cmd]" - done - else - compdef _bash_complete\ ${(j. .)${(q)args[1,-1-$#]}} "$@" - fi -} - -unfunction bashcompinit -autoload -Uz bashcompinit -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/before b/zsh_arm64/system/usr/share/zsh/functions/before deleted file mode 100644 index 7fb0166..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/before +++ /dev/null @@ -1,67 +0,0 @@ -# Glob qualifier function, e.g -# -# print *(e:after 2014/08/01:) -# print *(e-after today:12:00-) -# -# If named before: -# Match files modified before a given time. -# -# If named after: -# Match files modified after a given time. Use as glob qualifier. -# N.B.: "after" actually includes the given time as it is to second -# precision (it would be inconvenient to exclude the first second of a date). -# It should therefore more logically be called "from", but that's a less -# obvious name. -# -# File to test is in $REPLY. -# -# Similar to age, but only takes at most one data, which is -# compared directly with the current time. - -emulate -L zsh - -zmodload -F zsh/stat b:zstat -zmodload -i zsh/parameter - -autoload -Uz calendar_scandate - -local timefmt -local -a vals tmp - -[[ -e $REPLY ]] || return 1 -zstat -A vals +mtime -- $REPLY || return 1 - -if (( $# == 1 )); then - if [[ $1 = :* ]]; then - timefmt="%Y/%m/%d:%H:%M:%S" - zstat -A tmp -F $timefmt +mtime -- ${1#:} || return 1 - local AGEREF=$tmp[1] - else - local AGEREF=$1 - fi -fi - -integer mtime=$vals[1] date1 date2 -local REPLY REPLY2 - -# allow a time only (meaning today) -if calendar_scandate -t $AGEREF; then - date1=$REPLY - - case $0 in - (after) - (( mtime >= date1 )) - ;; - - (before) - (( mtime < date1 )) - ;; - - (*) - print "$0: must be named 'after' or 'before'" >&2 - return 1 - ;; - esac -else - return 1 -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/bracketed-paste-magic b/zsh_arm64/system/usr/share/zsh/functions/bracketed-paste-magic deleted file mode 100644 index 4baae82..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/bracketed-paste-magic +++ /dev/null @@ -1,222 +0,0 @@ -# Starting with zsh-5.1, ZLE began to recognize the "bracketed paste" -# capability of terminal emulators, that is, the sequences $'\e[200~' to -# start a paste and $'\e[201~' to indicate the end of the pasted text. -# Pastes are handled by the bracketed-paste widget and insert literally -# into the editor buffer rather than being interpreted as keystrokes. -# -# This disables some common usages where the self-insert widget has been -# replaced in order to accomplish some extra processing. An example is -# the contributed url-quote-magic widget. The bracketed-paste-magic -# widget replaces bracketed-paste with a wrapper that re-enables these -# self-insert actions, and other actions as selected by the zstyles -# described below. -# -# Setup: -# autoload -Uz bracketed-paste-magic -# zle -N bracketed-paste bracketed-paste-magic - -# The following zstyles may be set to control processing of pasted text. -# -# active-widgets -# Looked up in the context :bracketed-paste-magic to obtain a list of -# patterns that match widget names that should be activated during the -# paste. All other key sequences are processed as "zle .self-insert". -# The default is 'self-*' so any user-defined widgets named with that -# prefix are active along with the builtin self-insert. If this style is -# not set (note: it must be explicitly deleted after loading this -# function, otherwise it becomes set by default) or has no value, no -# widgets are active and the pasted text is inserted literally. If the -# value includes undefined-key, any unknown sequences are discarded from -# the pasted text. -# -# inactive-keys -# This is the inverse of active-widgets, it lists key sequences that -# always use "zle .self-insert" even when bound to an active-widget. -# Note that this is a list of literal key sequences, not patterns. -# This style is in context :bracketed-paste-magic and has no default. -# -# paste-init -# paste-finish -# Also looked up in the context :bracketed-paste-magic, these styles -# each are a list of function names. They are executed in widget -# context but are called as functions (NOT as widgets with "zle name"). -# As with hooks, the functions are called in order until one of them -# returns a nonzero exit status. The parameter PASTED contains the -# current state of the pasted text, other ZLE parameters are as usual. -# Although a nonzero status stops each list of functions, it does NOT -# abort the entire paste operation; use "zle send-break" for that. - -# IMPORTANT: During processing of the paste (after paste-init and -# before paste-finish), BUFFER starts empty and history is restricted, -# so cursor motions etc. may not pass outside of the pasted content. -# However, the paste-init functions have access to the full history and -# the original BUFFER, so they may for example move words from BUFFER -# into PASTED to make those words visible to the active-widgets. - -# Establish default values for styles, but only if not already set -zstyle -m :bracketed-paste-magic active-widgets '*' || - zstyle ':bracketed-paste-magic' active-widgets 'self-*' - -# Helper/example paste-init for exposing a word prefix inside PASTED. -# Useful with url-quote-magic if you have http://... on the line and -# are pasting additional text on the end of the URL. -# -# Usage: -# zstyle :bracketed-paste-magic paste-init backward-extend-paste -# -# TODO: rewrite this using match-words-by-style -# -backward-extend-paste() { - emulate -L zsh - integer bep_mark=$MARK bep_region=$REGION_ACTIVE - if (( REGION_ACTIVE && MARK < CURSOR )); then - zle .exchange-point-and-mark - fi - if (( CURSOR )); then - local -a bep_words=( ${(z)LBUFFER} ) - if [[ -n $bep_words[-1] && $LBUFFER = *$bep_words[-1] ]]; then - PASTED=$bep_words[-1]$PASTED - LBUFFER=${LBUFFER%${bep_words[-1]}} - fi - fi - if (( MARK > bep_mark )); then - zle .exchange-point-and-mark - fi - REGION_ACTIVE=$bep_region -} - -# Example paste-finish for quoting the pasted text. -# -# Usage e.g.: -# zstyle :bracketed-paste-magic paste-finish quote-paste -# zstyle :bracketed-paste-magic:finish quote-style qqq -# -# Using "zstyle -e" to examine $PASTED lets you choose different quotes -# depending on context. -# -# To forcibly turn off numeric prefix quoting, use e.g.: -# zstyle :bracketed-paste-magic:finish quote-style none -# -quote-paste() { - emulate -L zsh - local qstyle - # If there's a quoting style, be sure .bracketed-paste leaves it alone - zstyle -s :bracketed-paste-magic:finish quote-style qstyle && NUMERIC=1 - case $qstyle in - (b) PASTED=${(b)PASTED};; - (q-) PASTED=${(q-)PASTED};; - (\\|q) PASTED=${(q)PASTED};; - (\'|qq) PASTED=${(qq)PASTED};; - (\"|qqq) PASTED=${(qqq)PASTED};; - (\$|qqqq) PASTED=${(qqqq)PASTED};; - (Q) PASTED=${(Q)PASTED};; - esac -} - -# Now the actual function - -bracketed-paste-magic() { - if [[ "$LASTWIDGET" = *vi-set-buffer ]]; then - # Fast exit in the vi-mode cut-buffer context - zle .bracketed-paste - return - else - # Capture the pasted text in $PASTED - local PASTED REPLY - zle .bracketed-paste PASTED - fi - - # Really necessary to go to this much effort? - local bpm_emulate="$(emulate)" bpm_opts="$-" - - emulate -L zsh - local -a bpm_hooks bpm_inactive - local bpm_func bpm_active bpm_keymap=$KEYMAP - - # Run the paste-init functions - if zstyle -a :bracketed-paste-magic paste-init bpm_hooks; then - for bpm_func in $bpm_hooks; do - if (( $+functions[$bpm_func] )); then - function () { - emulate -L $bpm_emulate; set -$bpm_opts - $bpm_func || break - } - fi - done - fi - - zstyle -a :bracketed-paste-magic inactive-keys bpm_inactive - if zstyle -s :bracketed-paste-magic active-widgets bpm_active '|'; then - # Save context, create a clean slate for the paste - integer bpm_mark=$MARK bpm_region=$REGION_ACTIVE - integer bpm_numeric=${NUMERIC:-1} - integer bpm_limit=$UNDO_LIMIT_NO bpm_undo=$UNDO_CHANGE_NO - zle .split-undo - UNDO_LIMIT_NO=$UNDO_CHANGE_NO - BUFFER= - CURSOR=1 - fc -p -a /dev/null 0 0 - if [[ $bmp_keymap = vicmd ]]; then - zle -K viins - fi - - # There are active widgets. Reprocess $PASTED as keystrokes. - NUMERIC=1 - zle -U - $PASTED - - # Just in case there are active undo widgets - - while [[ -n $PASTED ]] && zle .read-command; do - PASTED=${PASTED#$KEYS} - if [[ $KEYS = ${(~j:|:)${(b)bpm_inactive}} ]]; then - zle .self-insert - else - case $REPLY in - (${~bpm_active}) function () { - emulate -L $bpm_emulate; set -$bpm_opts - zle $REPLY -w - };; - (*) zle .self-insert;; - esac - fi - done - PASTED=$BUFFER - - # Restore state - zle -K $bpm_keymap - fc -P - MARK=$bpm_mark - REGION_ACTIVE=$bpm_region - NUMERIC=$bpm_numeric - zle .undo $bpm_undo - UNDO_LIMIT_NO=$bpm_limit - fi - - # PASTED has been updated, run the paste-finish functions - if zstyle -a :bracketed-paste-magic paste-finish bpm_hooks; then - for bpm_func in $bpm_hooks; do - if (( $+functions[$bpm_func] )); then - function () { - emulate -L $bpm_emulate; set -$bpm_opts - $bpm_func || break - } - fi - done - fi - - # Reprocess $PASTED as an actual paste this time - zle -U - $PASTED$'\e[201~' # append paste-end marker - zle .bracketed-paste -- "$@" - zle .split-undo - - # Arrange to display highlighting if necessary - if [[ -z $zle_highlight || -n ${(M)zle_highlight:#paste:*} ]]; then - zle -R - zle .read-command && zle -U - $KEYS - fi -} - -# Handle zsh autoloading conventions -if [[ "$zsh_eval_context" = *loadautofunc && ! -o kshautoload ]]; then - bracketed-paste-magic "$@" -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/bracketed-paste-url-magic b/zsh_arm64/system/usr/share/zsh/functions/bracketed-paste-url-magic deleted file mode 100644 index b894696..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/bracketed-paste-url-magic +++ /dev/null @@ -1,44 +0,0 @@ -# bracketed-paste-url-magic quotes pasted urls automatically, if the -# paste exactly starts with a url, eg no spaces or other characters precede it -# -# If the numeric argument is provided (eg, pressing alt-0 or alt-1 in emacs mode, -# or just the number by itself in vi command mode), then -# 0 is the default and means auto detect urls -# 1 means always quote -# any other value means never quote -# -# To use this widget, put this in your startup files (eg, .zshrc) -# -# autoload -Uz bracketed-paste-url-magic -# zle -N bracketed-paste bracketed-paste-url-magic -# -# You can customize which schemas are to be quoted by using -# -# zstyle :bracketed-paste-url-magic schema http https ftp -# -# The default can be seen just below. - -local -a schema -zstyle -a :bracketed-paste-url-magic schema schema || schema=(http:// https:// ftp:// ftps:// file:// ssh:// sftp:// magnet:) - -local wantquote=${NUMERIC:-0} -local content -local start=$#LBUFFER - -zle .$WIDGET -N content - -if (( $wantquote == 0 )); then - if [[ $content = (${(~j:|:)schema})* ]]; then - wantquote=1 - fi -fi - -if (( $wantquote == 1 )); then - content=${(q-)content} -fi - -LBUFFER+=$content - -YANK_START=$start -YANK_END=$#LBUFFER -zle -f yank diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar b/zsh_arm64/system/usr/share/zsh/functions/calendar deleted file mode 100644 index aff39b3..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar +++ /dev/null @@ -1,445 +0,0 @@ -emulate -L zsh -setopt extendedglob - -local line showline restline REPLY REPLY2 userange nobackup datefmt -local calendar donefile sched newfile warnstr mywarnstr newdate -integer time start stop today ndays y m d next=-1 shown done nodone -integer verbose warntime mywarntime t tcalc tsched i rstat remaining -integer showcount icount repeating repeattime resched showall brief -local -a calendar_entries calendar_addlines -local -a times calopts showprog lockfiles match mbegin mend tmplines -local -A reply - -zmodload -i zsh/datetime || return 1 -zmodload -i zsh/zutil || return 1 -zmodload -F zsh/files b:zf_ln || return 1 - -autoload -Uz calendar_{add,parse,read,scandate,show,lockfiles} - -# Read the calendar file from the calendar-file style -zstyle -s ':datetime:calendar:' calendar-file calendar || calendar=~/calendar -newfile=$calendar.new.$HOST.$$ -zstyle -s ':datetime:calendar:' done-file donefile || donefile="$calendar.done" -# Read the programme to show the message from the show-prog style. -zstyle -a ':datetime:calendar:' show-prog showprog || - showprog=(calendar_show) -# Amount of time before an event when it should be flagged. -# May be overridden in individual entries -zstyle -s ':datetime:calendar:' warn-time warnstr || warnstr="0:05" -# default to standard ctime date/time format -zstyle -s ':datetime:calendar:' date-format datefmt || - datefmt="%a %b %d %H:%M:%S %Z %Y" - -if [[ -n $warnstr ]]; then - if [[ $warnstr = <-> ]]; then - (( warntime = warnstr )) - elif ! calendar_scandate -ar $warnstr; then - print >&2 \ - "warn-time value '$warnstr' not understood; using default 5 minutes" - warnstr="5 mins" - (( warntime = 5 * 60 )) - else - (( warntime = REPLY )) - fi -fi - -[[ -f $calendar ]] || return 1 - -# We're not using getopts because we want +... to refer to a -# relative time, not an option, and allow some other additions -# like handling -<->. -integer opti=0 -local opt optrest optarg - -while [[ ${argv[opti+1]} = -* ]]; do - (( opti++ )) - opt=${argv[opti][2]} - optrest=${argv[opti][3,-1]} - [[ -z $opt || $opt = - ]] && break - while [[ -n $opt ]]; do - case $opt in - ######################## - # Options with arguments - ######################## - ([BCnS]) - if [[ -n $optrest ]]; then - optarg=$optrest - optrest= - elif (( opti < $# )); then - optarg=$argv[++opti] - optrest= - else - print -r "$0: option -$opt requires an argument." >&2 - return 1 - fi - case $opt in - (B) - # Brief, with number of lines to show. - brief=$optarg - if (( brief <= 0 )); then - print -r "$0: option -$opt requires a positive integer." >&2 - return 1 - fi - ;; - - (C) - # Pick the calendar file, overriding style and default. - calendar=$optarg - ;; - - (n) - # Show this many remaining events regardless of date. - showcount=$optarg - if (( showcount <= 0 )); then - print -r "$0: option -$opt requires a positive integer." >&2 - return 1 - fi - ;; - - (S) - # Explicitly specify a show programme, overriding style and default. - # Colons in the argument are turned into space. - showprog=(${(s.:.)optarg}) - ;; - esac - ;; - - ########################### - # Options without arguments - ########################### - (a) - # Show all entries - (( showall = 1 )) - ;; - - (b) - # Brief: don't show continuation lines - (( brief = 1 )) - ;; - - (d) - # Move out of date items to the done file. - (( done = 1 )) - ;; - - (D) - # Don't use done; needed with sched - (( nodone = 1 )) - ;; - - (r) - # Show all remaining options in the calendar, i.e. - # respect start time but ignore end time. - # Any argument is treated as a start time. - (( remaining = 1 )) - ;; - - (s) - # Use the "sched" builtin to scan at the appropriate time. - sched=sched - (( done = 1 )) - ;; - - (v) - # Verbose - verbose=1 - ;; - - (<->) - # Shorthand for -n <-> - showcount=$opt - ;; - - (*) - print "$0: unrecognised option: -$opt" >&2 - return 1 - ;; - esac - opt=$optrest[1] - optrest=$optrest[2,-1] - done -done -calopts=($argv[1,opti]) -shift $(( opti )) - -# Use of donefile requires explicit or implicit option request, plus -# no explicit -D. It may already be empty because of the style. -(( done && !nodone )) || donefile= - -if (( $# > 1 || ($# == 1 && remaining) )); then - if [[ $1 = now ]]; then - start=$EPOCHSECONDS - elif [[ $1 = <-> ]]; then - start=$1 - else - if ! calendar_scandate -a $1; then - print "$0: failed to parse date/time: $1" >&2 - return 1 - fi - start=$REPLY - fi - shift -else - # Get the time at which today started. - y=${(%):-"%D{%Y}"} m=${(%):-"%D{%m}"} d=${(%):-"%D{%d}"} - strftime -s today -r "%Y/%m/%d" "$y/$m/$d" - start=$today -fi -# day of week of start time -strftime -s wd "%u" $start - -if (( $# && !remaining )); then - if [[ $1 = +* ]]; then - if ! calendar_scandate -a -R $start ${1[2,-1]}; then - print "$0: failed to parse relative time: $1" >&2 - return 1 - fi - (( stop = REPLY )) - elif [[ $1 = <-> ]]; then - stop=$1 - else - if ! calendar_scandate -a $1; then - print "$0: failed to parse date/time: $1" >&2 - return 1 - fi - stop=$REPLY - fi - if (( stop < start )); then - strftime -s REPLY $datefmt $start - strftime -s REPLY2 $datefmt $stop - print "$0: requested end time is before start time: - start: $REPLY - end: $REPLY2" >&2 - return 1 - fi - shift -else - # By default, show 2 days. If it's Friday (5) show up to end - # of Monday (4) days; likewise on Saturday show 3 days. - # If -r, this is calculated but not used. This is paranoia, - # to avoid an unusable value of stop; but it shouldn't get used. - case $wd in - (5) - ndays=4 - ;; - - (6) - ndays=3 - ;; - - (*) - ndays=2 - ;; - esac - stop=$(( start + ndays * 24 * 60 * 60 )) -fi - -if (( $# )); then - print "Usage: $0 [ start-date-time stop-date-time ]" >&2 - return 1 -fi - -autoload -Uz matchdate - -[[ -n $donefile ]] && rm -f $newfile - -if (( verbose )); then - print -n "start: " - strftime $datefmt $start - print -n "stop: " - if (( remaining )); then - print "none" - else - strftime $datefmt $stop - fi -fi - -local mycmds="${TMPPREFIX:-/tmp/zsh}.calendar_cmds.$$" -zf_ln -fn =(<<<'') $mycmds || return 1 - -# start of subshell for OS file locking -( -# start of block for following always to clear up lockfiles. -# Not needed but harmless if OS file locking is used. -{ - if [[ -n $donefile ]]; then - # Attempt to lock both $donefile and $calendar. - # Don't lock $newfile; we've tried our best to make - # the name unique. - if zmodload -F zsh/system b:zsystem && zsystem supports flock && - zsystem flock $calendar 2>/dev/null && - zsystem flock $donefile 2>/dev/null; then - # locked OK - : - else - calendar_lockfiles $calendar $donefile || exit 1 - fi - fi - - calendar_read $calendar - for line in $calendar_entries; do - calendar_parse $line || continue - - # Extract returned parameters from $reply - # Time of event - (( t = ${reply[time]} )) - # Remainder of line including RPT and WARN stuff: we need - # to keep these for rescheduling. - restline=$reply[text1] - # Look for specific warn time. - if [[ -n ${reply[warntime]} ]]; then - (( mywarntime = t - ${reply[warntime]} )) - mywarnstr=${reply[warnstr]} - else - (( mywarntime = warntime )) - mywarnstr=$warnstr - fi - # Look for a repeat time. - if [[ -n ${reply[rpttime]} ]]; then - # The actual time of the next event, which appears as text - (( repeattime = ${reply[rpttime]} )) - (( repeating = 1 )) - else - (( repeating = 0 )) - fi - # Finished extracting parameters from $reply - - if (( verbose )); then - print "Examining: $line" - print -n " Date/time: " - strftime $datefmt $t - if [[ -n $sched ]]; then - print " Warning $mywarntime seconds ($mywarnstr) before" - fi - fi - (( shown = 0 )) - if (( brief )); then - tmplines=("${(f)line}") - showline=${(F)${${tmplines[1,brief]}}} - else - showline=$line - fi - match=() - # Strip continuation lines starting " #". - while [[ $showline = (#b)(*$'\n')[[:space:]]##\#[^$'\n']##(|$'\n'(*)) ]]; do - showline="$match[1]$match[3]" - done - # Strip trailing empty lines - showline=${showline%%[[:space:]]#} - if (( showall || (t >= start && (remaining || t <= stop || icount < showcount)) )) - then - print -r -- ${(qq)showprog} $start $stop ${(qq)showline} >>$mycmds - (( icount++ )) - # Doesn't count as "shown" unless the event has now passed. - (( t <= EPOCHSECONDS )) && (( shown = 1 )) - elif [[ -n $sched ]]; then - (( tsched = t - mywarntime )) - if (( tsched >= start && tsched <= stop)); then - showline="due in ${mywarnstr}: $showline" - print -r -- ${(qq)showprog} $start $stop ${(qq)showline} >>$mycmds - elif (( tsched < start )); then - # We haven't actually shown it, but it's in the past, - # so treat it the same. Should probably rename this variable. - (( shown = 1 )) - fi - fi - if [[ -n $sched ]]; then - if (( shown && repeating )); then - # Done and dusted, but a repeated event is due. - strftime -s newdate $datefmt $repeattime - if [[ $newdate != *[[:space:]] && $restline != [[:space:]]* ]]; then - newdate+=" " - fi - calendar_addlines+=("$newdate$restline") - - # We'll add this back in below, but we check in case the - # repeated event is the next one due. It's not - # actually a disaster if there's an error and we fail - # to add the time. Always try to reschedule this event. - (( tcalc = repeattime, resched = 1 )) - else - (( tcalc = t )) - fi - - if (( tcalc - mywarntime > EPOCHSECONDS )); then - # schedule for a warning - (( tsched = tcalc - mywarntime, resched = 1 )) - else - # schedule for event itself - (( tsched = tcalc )) - # but don't schedule unless the event has not yet been shown. - (( !shown )) && (( resched = 1 )) - fi - if (( resched && (next < 0 || tsched < next) )); then - (( next = tsched )) - fi - fi - if [[ -n $donefile ]]; then - if (( shown )); then - # Done and dusted. - if ! print -r $line >>$donefile; then - if (( done != 3 )); then - (( done = 3 )) - print "Failed to append to $donefile" >&2 - fi - elif (( done != 3 )); then - (( done = 2 )) - fi - else - # Still not over. - if ! print -r $line >>$newfile; then - if (( done != 3 )); then - (( done = 3 )) - print "Failed to append to $newfile" >&2 - fi - elif (( done != 3 )); then - (( done = 2 )) - fi - fi - fi - done - - if [[ -n $sched ]]; then - if [[ $next -ge 0 ]]; then - # Remove any existing calendar scheduling. - i=${"${(@)zsh_scheduled_events#*:*:}"[(I)calendar -s*]} - { - (( i )) && print sched -$i - print -r -- ${(qq)sched} $next calendar "${calopts[@]}" $next $next - } >>$mycmds - else - showline="No more calendar events: calendar not rescheduled. -Run \"calendar -s\" again if you add to it." - print -r -- ${(qq)showprog} $start $stop ${(qq)showline} >>$mycmds - fi - fi - - if (( done == 2 )); then - if ! mv $calendar $calendar.old; then - print "Couldn't back up $calendar to $calendar.old. -New calendar left in $newfile." >&2 - (( rstat = 1 )) - elif ! mv $newfile $calendar; then - print "Failed to rename $newfile to $calendar. -Old calendar left in $calendar.old." >&2 - (( rstat = 1 )) - fi - nobackup=-B - elif [[ -n $donefile ]]; then - rm -f $newfile - fi - - # Reschedule repeating events. - for line in $calendar_addlines; do - calendar_add -L $nobackup $line - done -} always { - (( ${#lockfiles} )) && rm -f $lockfiles -} - -exit $rstat -) && { - # Tasks that need to be in the current shell - [[ -s $mycmds ]] && . $mycmds - rm -f $mycmds -} diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_add b/zsh_arm64/system/usr/share/zsh/functions/calendar_add deleted file mode 100755 index f71400f..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_add +++ /dev/null @@ -1,259 +0,0 @@ -#!/bin/zsh -# All arguments are joined with spaces and inserted into the calendar -# file at the appropriate point. -# -# While the function compares the date of the new entry with dates in the -# existing calendar file, it does not do any sorting; it inserts the new -# entry before the first existing entry with a later date and time. - -emulate -L zsh -setopt extendedglob # xtrace - -local context=":datetime:calendar_add:" -local vdatefmt="%Y%m%dT%H%M%S" -local d='[[:digit:]]' - -local calendar newfile REPLY lastline opt text occur -local -a calendar_entries lockfiles reply occurrences -integer my_date done rstat nolock nobackup new_recurring -integer keep_my_uid -local -A reply parse_new parse_old -local -a match mbegin mend -local my_uid their_uid - -autoload -Uz calendar_{parse,read,lockfiles} - -while getopts "BL" opt; do - case $opt in - (B) - nobackup=1 - ;; - - (L) - nolock=1 - ;; - - (*) - return 1 - ;; - esac -done -shift $(( OPTIND - 1 )) - -# Read the calendar file from the calendar-file style -zstyle -s $context calendar-file calendar || - calendar=~/calendar -newfile=$calendar.new.$HOST.$$ - -local addline="$*" -if ! calendar_parse $addline; then - print "$0: failed to parse date/time" >&2 - return 1 -fi -parse_new=("${(@kv)reply}") -(( my_date = $parse_new[time] )) -if zstyle -t $context reformat-date; then - local datefmt - zstyle -s $context date-format datefmt || - datefmt="%a %b %d %H:%M:%S %Z %Y" - strftime -s REPLY $datefmt $parse_new[time] - addline="$REPLY $parse_new[text1]" -fi -if [[ -n $parse_new[rptstr] ]]; then - (( new_recurring = 1 )) - if [[ $parse_new[rptstr] = CANCELLED ]]; then - (( done = 1 )) - elif [[ $addline = (#b)(*[[:space:]\#]RECURRENCE[[:space:]]##)([^[:space:]]##)([[:space:]]*|) ]]; then - # Use the updated recurrence time - strftime -s REPLY $vdatefmt ${parse_new[schedrpttime]} - addline="${match[1]}$REPLY${match[3]}" - else - # Add a recurrence time - [[ $addline = *$'\n' ]] || addline+=$'\n' - strftime -s REPLY $vdatefmt ${parse_new[schedrpttime]} - addline+=" # RECURRENCE $REPLY" - fi -fi - -# $calendar doesn't necessarily exist yet. - -# Match a UID, a unique identifier for the entry inherited from -# text/calendar format. -local uidpat='(|*[[:space:]])UID[[:space:]]##(#b)([[:xdigit:]]##)(|[[:space:]]*)' -if [[ $addline = ${~uidpat} ]]; then - my_uid=${(U)match[1]} -fi - -# start of subshell for OS file locking -( -# start of block for following always to clear up lockfiles. -# Not needed but harmless if OS file locking is used. -{ - if (( ! nolock )); then - if zmodload -F zsh/system b:zsystem && zsystem supports flock && - zsystem flock $calendar 2>/dev/null; then - # locked OK - : - else - calendar_lockfiles $calendar || exit 1 - fi - fi - - if [[ -f $calendar ]]; then - calendar_read $calendar - - if [[ -n $my_uid ]]; then - # Pre-scan to events with the same UID - for line in $calendar_entries; do - calendar_parse $line || continue - parse_old=("${(@kv)reply}") - # Recurring with a UID? - if [[ $line = ${~uidpat} ]]; then - their_uid=${(U)match[1]} - if [[ $their_uid = $my_uid ]]; then - # Deal with recurrences and also some add some - # extra magic for cancellation. - - # See if we have found a recurrent version - if [[ -z $parse_old[rpttime] ]]; then - # No, so assume this is a straightforward replacement - # of a non-recurring event. - - # Is this a cancellation of a non-recurring event? - # Look for an OCCURRENCE in the form - # OCCURRENCE 20100513T110000 CANCELLED - # although we don't bother looking at the date/time--- - # it's one-off, so this should already be unique. - if [[ $new_recurring -eq 0 && \ - $parse_new[text1] = (|*[[:space:]\#])"OCCURRENCE"[[:space:]]##([^[:space:]]##[[:space:]]##CANCELLED)(|[[:space:]]*) ]]; then - # Yes, so skip both the old and new events. - (( done = 1 )) - fi - # We'll skip this UID when we encounter it again. - continue - fi - if (( new_recurring )); then - # Replacing a recurrence; there can be only one. - # TBD: do we replace existing occurrences of the - # replaced recurrent event? I'm guessing not, but - # if we keep the UID then maybe we should. - # - # TBD: ick, suppose we're cancelling an even that - # we added to a recurring sequence but didn't replace - # the recurrence. We might get RPT CANCELLED for this. - # That would be bad. Should invent better way of - # cancelling non-recurring event. - continue - else - # The recorded event is recurring, but the new one is a - # one-off event. If there are embedded OCCURRENCE declarations, - # use those. - # - # TBD: We could be clever about text associated - # with the occurrence. Copying the entire text - # of the meeting seems like overkill but people often - # add specific remarks about why this occurrence was - # moved/cancelled. - # - # TBD: one case we don't yet handle is cancelling - # something that isn't replacing a recurrence, i.e. - # something we added as OCCURRENCE XXXXXXXXTXXXXXX . - # If we're adding a CANCELLED occurrence we should - # look to see if it matches and if so simply - # delete that occurrence. - # - # TBD: one nasty case is if the new occurrence - # occurs before the current scheduled time. As we - # never look backwards we'll miss it. - text=$addline - occurrences=() - while [[ $text = (#b)(|*[[:space:]\#])"OCCURRENCE"[[:space:]]##([^[:space:]]##[[:space:]]##[^[:space:]]##)(|[[:space:]]*) ]]; do - occurrences+=($match[2]) - text="$match[1] $match[3]" - done - if (( ! ${#occurrences} )); then - # No embedded occurrences. We'll manufacture one - # that doesn't refer to an original recurrence. - strftime -s REPLY $vdatefmt $my_date - occurrences=("XXXXXXXXTXXXXXX $REPLY") - fi - # Add these occurrences, checking if they replace - # an existing one. - for occur in ${(o)occurrences}; do - REPLY=${occur%%[[:space:]]*} - # Only update occurrences that refer to genuine - # recurrences. - if [[ $REPLY = [[:digit:]](#c8)T[[:digit:]](#c6) && $line = (#b)(|*[[:space:]\#])(OCCURRENCE[[:space:]]##)${REPLY}[[:space:]]##[^[:space:]]##(|[[:space:]]*) ]]; then - # Yes, update in situ - line="${match[1]}${match[2]}$occur${match[3]}" - else - # No, append. - [[ $line = *$'\n' ]] || line+=$'\n' - line+=" # OCCURRENCE $occur" - fi - done - # The line we're adding now corresponds to the - # original event. We'll skip the matching UID - # in the file below, however. - addline=$line - # We need to work out which event is next, so - # reparse. - if calendar_parse $addline; then - parse_new=("${(@kv)reply}") - (( my_date = ${parse_new[time]} )) - if zstyle -t $context reformat-date; then - zstyle -s $context date-format datefmt - strftime -s REPLY $datefmt $parse_new[time] - addline="$REPLY $parse_new[text1]" - fi - fi - fi - fi - fi - done - fi - - { - for line in $calendar_entries; do - calendar_parse $line || continue - parse_old=("${(@kv)reply}") - if (( ! done && ${parse_old[time]} > my_date )); then - print -r -- $addline - (( done = 1 )) - fi - # We've already merged any information on the same UID - # with our new text, probably. - if [[ $keep_my_uid -eq 0 && -n $my_uid && $line = ${~uidpat} ]]; then - their_uid=${(U)match[1]} - [[ $my_uid = $their_uid ]] && continue - fi - if [[ $parse_old[time] -eq $my_date && $line = $addline ]]; then - (( done )) && continue # paranoia: shouldn't happen - (( done = 1 )) - fi - print -r -- $line - done - (( done )) || print -r -- $addline - } >$newfile - if (( ! nobackup )); then - if ! mv $calendar $calendar.old; then - print "Couldn't back up $calendar to $calendar.old. -New calendar left in $newfile." >&2 - (( rstat = 1 )) - fi - fi - else - (( done )) || print -r -- $addline >$newfile - fi - - if (( !rstat )) && ! mv $newfile $calendar; then - print "Failed to rename $newfile to $calendar. -Old calendar left in $calendar.old." >&2 - (( rstat = 1 )) - fi -} always { - (( ${#lockfiles} )) && rm -f $lockfiles -} - -exit $rstat -) diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_edit b/zsh_arm64/system/usr/share/zsh/functions/calendar_edit deleted file mode 100644 index ae88850..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_edit +++ /dev/null @@ -1,37 +0,0 @@ -local line calendar -local -a lockfiles editor - -integer cal_running - -if (( $# )); then - editor=("$@") -else - editor=(${VISUAL:-${EDITOR:-vi}}) -fi - -sched | while read line; do - [[ $line = *" calendar -s "<->" "<-> ]] && (( cal_running = 1 )) -done - -zstyle -s ':datetime:calendar:' calendar-file calendar || calendar=~/calendar - -# start of subshell for OS file locking -( -# start of block for following always to clear up lockfiles. -# Not needed but harmless if OS file locking is used. -{ - if zmodload -F zsh/system b:zsystem && zsystem supports flock && - zsystem flock $calendar 2>/dev/null; then - # locked OK - : - else - calendar_lockfiles $calendar || exit 1 - fi - - eval $editor \$calendar -} always { - (( ${#lockfiles} )) && rm -f $lockfiles -} -) - -(( cal_running )) && calendar -s diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_lockfiles b/zsh_arm64/system/usr/share/zsh/functions/calendar_lockfiles deleted file mode 100644 index 93fbce0..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_lockfiles +++ /dev/null @@ -1,55 +0,0 @@ -# Lock the given files. -# Append the names of lockfiles to the array lockfiles. - -local file lockfile msgdone -# Number of attempts to lock a file. Probably not worth stylising. -integer lockattempts=4 loadtried - -# The lockfile name is not stylised: it has to be a fixed -# derivative of the main fail. -for file; do - lockfile=$file.lockfile - for (( i = 0; i <= lockattempts; i++ )); do - if ln -s $file $lockfile >/dev/null 2>&1; then - lockfiles+=($lockfile) - break - fi - if zle && [[ -z $msgdone ]]; then - msgdone="${lockfile}: waiting to acquire lock" - zle -M $msgdone - fi - if (( ! loadtried )); then - zmodload -i zsh/zselect 2>/dev/null - (( loadtried = 1 )) - fi - if zmodload -e zsh/zselect; then - # This gives us finer grained timing (100th second). - # Randomize the sleep between .1 and 2 seconds so that - # we are much less likely to have multiple instances - # retrying at once. - zselect -t $(( 10 + RANDOM * 190 / 32768 )) - else - sleep 1 - fi - done - if [[ -n $msgdone ]]; then - zle -M ${msgdone//?/ } - msgdone= - fi - if [[ ${lockfiles[-1]} != $lockfile ]]; then - msgdone="Failed to lock $file; giving up after $lockattempts attempts. -Another instance of calendar may be using it. -Delete $lockfiles if you believe this to be an error." - if zle; then - zle -M $msgdone - else - print $msgdone >&2 - fi - # The parent should take action to delete any lockfiles - # already locked. Typically this won't be necessary, since - # we will always lock the main calendar file first. - return 1 - fi -done - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_parse b/zsh_arm64/system/usr/share/zsh/functions/calendar_parse deleted file mode 100644 index fabaf74..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_parse +++ /dev/null @@ -1,176 +0,0 @@ -# Parse the line passed down in the first argument as a calendar entry. -# Sets the values parsed into the associative array reply, consisting of: -# time The time as an integer (as per EPOCHSECONDS) of the (next) event. -# text1 The text from the line not including the date/time, but -# including any WARN or RPT text. This is useful for rescheduling -# events, since the keywords need to be retained in this case. -# warntime Any warning time (WARN keyword) as an integer, else an empty -# string. This is the time of the warning in units of EPOCHSECONDS, -# not the parsed version of the original number (which was a time -# difference). -# warnstr Any warning time as the original string (e.g. "5 mins"), not -# including the WARN keyword. -# schedrpttime The next scheduled recurrence (which may be cancelled -# or rescheduled). -# rpttime The actual occurrence time: the event may have been rescheduled, -# in which case this is the time of the actual event (for use in -# programming warnings etc.) rather than that of the normal -# recurrence (which is recorded by calendar_add as RECURRENCE). -# -# rptstr Any repeat/recurrence time as the original string. -# text2 The text from the line with the date and other keywords and -# values removed. -# -# Note that here an "integer" is a string of digits, not an internally -# formatted integer. -# -# Return status 1 if parsing failed. reply is set to an empty -# in this case. Note the caller is responsible for -# making reply local. - -emulate -L zsh -setopt extendedglob - -local vdatefmt="%Y%m%dT%H%M%S" - -local REPLY REPLY2 timefmt occurrence skip try_to_recover before after -local -a match mbegin mend -integer now then replaced firstsched schedrpt -# Any text matching "OCCURRENCE " -# may occur multiple times. We set occurrences[]=disposition. -local -A occurrences - -autoload -Uz calendar_scandate - -typeset -gA reply - -reply=() - -if (( $# != 1 )); then - print "Usage: $0 calendar-entry" >&2 - return 2 -fi - -# This call sets REPLY to the date and time in seconds since the epoch, -# REPLY2 to the line with the date and time removed. -calendar_scandate -as $1 || return 1 -reply[time]=$(( REPLY )) -schedrpt=${reply[time]} -reply[text1]=${REPLY2##[[:space:]]#} -reply[text2]=${reply[text1]} - -while true; do - - case ${reply[text2]} in - # First check for a scheduled repeat time. If we don't find one - # we'll use the normal time. - ((#b)(*[[:space:]\#])RECURRENCE[[:space:]]##([^[:space:]]##)([[:space:]]*|)) - strftime -rs then $vdatefmt ${match[2]} || - print "format: $vdatefmt, string ${match[2]}" >&2 - schedrpt=$then - reply[text2]="${match[1]}${match[3]##[ ]#}" - ;; - - # Look for specific warn time. - ((#b)(|*[[:space:],])WARN[[:space:]](*)) - if calendar_scandate -asm -R $reply[time] $match[2]; then - reply[warntime]=$REPLY - reply[warnstr]=${match[2]%%"$REPLY2"} - # Remove spaces and tabs but not newlines from trailing text, - # else the formatting looks funny. - reply[text2]="${match[1]}${REPLY2##[ ]#}" - else - # Just remove the keyword for further parsing - reply[text2]="${match[1]}${match[2]##[ ]#}" - fi - ;; - - ((#b)(|*[[:space:],])RPT[[:space:]](*)) - before=${match[1]} - after=${match[2]} - if [[ $after = CANCELLED(|[[:space:]]*) ]]; then - reply[text2]="$before${match[2]##[ ]#}" - reply[rptstr]=CANCELLED - reply[rpttime]=CANCELLED - reply[schedrpttime]=CANCELLED - elif calendar_scandate -a -R $schedrpt $after; then - # It's possible to calculate a recurrence, however we don't - # do that yet. For now just keep the current time as - # the recurrence. Hence we ignore REPLY. - reply[text2]="$before${REPLY2##[ ]#}" - reply[rptstr]=${after%%"$REPLY2"} - # Until we find an individual occurrence, the actual time - # of the event is the regular one. - reply[rpttime]=$schedrpt - else - # Just remove the keyword for further parsing - reply[text2]="$before${after##[[:space:]]#}" - fi - ;; - - ((#b)(|*[[:space:]\#])OCCURRENCE[[:space:]]##([^[:space:]]##)[[:space:]]##([^[:space:]]##)(*)) - occurrences[${match[2]}]="${match[3]}" - # as above - reply[text2]="${match[1]}${match[4]##[ ]#}" - ;; - - (*) - break - ;; - esac -done - -if [[ -n ${reply[rpttime]} && ${reply[rptstr]} != CANCELLED ]]; then - # Recurring event. We need to find out when it recurs. - (( now = EPOCHSECONDS )) - - # First find the next recurrence. - replaced=0 - reply[schedrpttime]=$schedrpt - if (( schedrpt >= now )); then - firstsched=$schedrpt - fi - while (( ${reply[schedrpttime]} < now || replaced )); do - if ! calendar_scandate -a -R ${reply[schedrpttime]} ${reply[rptstr]}; then - break - fi - if (( REPLY <= ${reply[schedrpttime]} )); then - # going backwards --- pathological case - break; - fi - reply[schedrpttime]=$REPLY - reply[rpttime]=$REPLY - if (( ${reply[schedrpttime]} > now && firstsched == 0 )); then - firstsched=$REPLY - fi - replaced=0 - # do we have an occurrence to compare against? - if (( ${#occurrences} )); then - strftime -s timefmt $vdatefmt ${reply[schedrpttime]} - occurrence=$occurrences[$timefmt] - if [[ -n $occurrence ]]; then - # Yes, this replaces the scheduled one. - replaced=1 - fi - fi - done - # Now look through occurrences (values only) and see which are (i) still - # to happen (ii) early than the current rpttime. - for occurrence in $occurrences; do - if [[ $occurrence != CANCELLED ]]; then - strftime -rs then $vdatefmt $occurrence || - print "format: $vdatefmt, string $occurrence" >&2 - if (( then > now && then < ${reply[rpttime]} )); then - reply[rpttime]=$then - fi - fi - done - # Finally, update the scheduled repeat time to the earliest - # possible value. This is so that if an occurrence replacement is - # cancelled we pick up the regular one. Can this happen? Dunno. - reply[schedrpttime]=$firstsched -fi - -reply[text2]="${reply[text2]##[[:space:],]#}" - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_read b/zsh_arm64/system/usr/share/zsh/functions/calendar_read deleted file mode 100644 index ed16388..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_read +++ /dev/null @@ -1,35 +0,0 @@ -# Utility for "calendar" to read entries into the array calendar_entries. -# This should be local to the caller. -# The only argument is the file to read. We expect options etc. to -# be correct. -# -# This is based on Emacs calendar syntax, which has two implications: -# - Lines beginning with whitespace are continuation lines. -# Hence we have to read the entire file first to determine entries. -# - Lines beginning with "&" are inhibited from producing marks in -# Emacs calendar window. This is irrelevant to us, so we -# we simply remove leading ampersands. This is necessary since -# we expect the date to start at the beginning of the line. -# -# TODO: Emacs has some special handling for entries where the first line -# has only the date and continuation lines indicate times. Actually, -# it doesn't parse the times as far as I can see, but if we want to -# handle that format sensibly we would need to here. It could -# be tricky to get right. - -local calendar=$1 line -local -a lines - -lines=(${(f)"$(<$calendar)"}) - -calendar_entries=() -# ignore blank lines -for line in $lines; do - if [[ $line = [[:space:]]* ]]; then - if (( ${#calendar_entries} )); then - calendar_entries[-1]+=$'\n'$line - fi - else - calendar_entries+=(${line##\&}) - fi -done diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_scandate b/zsh_arm64/system/usr/share/zsh/functions/calendar_scandate deleted file mode 100644 index b3a5837..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_scandate +++ /dev/null @@ -1,801 +0,0 @@ -# Scan a line for various common date and time formats. -# Set REPLY to the number of seconds since the epoch at which that -# time occurs. The time does not need to be matched; this will -# produce midnight at the start of the date. -# -# Absolute times -# -# The rules below are fairly complicated, to allow any natural (and -# some highly unnatural but nonetheless common) combination of -# time and date used by English speakers. It is recommended that, -# rather than exploring the intricacies of the system, users find -# a date format that is natural to them and stick to it. This -# will avoid unexpected effects. Various key facts should be noted, -# explained in more detail below: -# -# - In particular, note the confusion between month/day/year and -# day/month/year when the month is numeric; this format should be -# avoided if at all possible. Many alternatives are available. -# - However, there is currently no localization support, so month -# names must be English (though only the first three letters are required). -# The same applies to days of the week if they occur (they are not useful). -# - The year must be given in full to avoid confusion, and only years -# from 1900 to 2099 inclusive are matched. -# - Although timezones are parsed (complicated formats may not be recognized), -# they are then ignored; no time adjustment is made. -# - Embedding of times within dates (e.g. "Wed Jun 16 09:30:00 BST 2010") -# causes horrific problems because of the combination of the many -# possible date and time formats to match. The approach taken -# here is to match the time, remove it, and see if the nearby text -# looks like a date. The problem is that the time matched may not -# be that associated with the date, in which case the time will be -# ignored. To minimise this, when the argument "-a" is given to -# anchor the date/time to the start of the line, we never look -# beyond a newline. So if any date/time strings in the text -# are on separate lines the problem is avoided. -# - If you feel sophisticated enough and wish to avoid any ambiguity, -# you can use RFC 2445 date/time strings, for example 20100601T170000. -# These are parsed in one go. -# -# The following give some obvious examples; users finding here -# a format they like and not subject to vagaries of style may skip -# the full description. As dates and times are matched separately -# (even though the time may be embedded in the date), any date format -# may be mixed with any format for the time of day provide the -# separators are clear (whitespace, colons, commas). -# 2007/04/03 13:13 -# 2007/04/03:13:13 -# 2007/04/03 1:13 pm -# 3rd April 2007, 13:13 -# April 3rd 2007 1:13 p.m. -# Apr 3, 2007 13:13 -# Tue Apr 03 13:13:00 2007 -# 13:13 2007/apr/3 -# -# Times are parsed and extracted before dates. They must use colons -# to separate hours and minutes, though a dot is allowed before seconds -# if they are present. This limits time formats to -# HH:MM[:SS[.FFFFF]] [am|pm|a.m.|p.m.] -# HH:MM.SS[.FFFFF] [am|pm|a.m.|p.m.] -# in which square brackets indicate optional elements, possibly with -# alternatives. Fractions of a second are recognised but ignored. -# Unless -r or -R are given (see below), a date is mandatory but a time of day is -# not; the time returned is at the start of the date. -# -# Time zones are not handled, though if one is matched following a time -# specification it will be removed to allow a surrounding date to be -# parsed. This only happens if the format of the timezone is not too -# wacky: -# +0100 -# GMT -# GMT-7 -# CET+1CDT -# etc. are all understood, but any part of the timezone that is not numeric -# must have exactly three capital letters in the name. -# -# Dates suffer from the ambiguity between DD/MM/YYYY and MM/DD/YYYY. It is -# recommended this form is avoided with purely numeric dates, but use of -# ordinals, eg. 3rd/04/2007, will resolve the ambiguity as the ordinal is -# always parsed as the day of the month. Years must be four digits (and -# the first two must be 19 or 20); 03/04/08 is not recognised. Other -# numbers may have leading zeroes, but they are not required. The -# following are handled: -# YYYY/MM/DD -# YYYY-MM-DD -# YYYY/MNM/DD -# YYYY-MNM-DD -# DD[th|st|rd] MNM[,] YYYY -# DD[th|st|rd] MNM[,] current year assumed -# MNM DD[th|st|rd][,] YYYY -# MNM DD[th|st|rd][,] current year assumed -# DD[th|st|rd]/MM[,] YYYY -# DD[th|st|rd]/MM/YYYY -# MM/DD[th|st|rd][,] YYYY -# MM/DD[th|st|rd]/YYYY -# Here, MNM is at least the first three letters of a month name, -# matched case-insensitively. The remainder of the month name may appear but -# its contents are irrelevant, so janissary, febrile, martial, apricot, -# etc. are happily handled. -# -# Note there are only two cases that assume the current year, the -# form "Jun 20" or "14 September" (the only two commonly occurring -# forms, apart from a "the" in some forms of English, which isn't -# currently supported). Such dates will of course become ambiguous -# in the future, so should ideally be avoided. -# -# Times may follow dates with a colon, e.g. 1965/07/12:09:45; this -# is in order to provide a format with no whitespace. A comma -# and whitespace are allowed, e.g. "1965/07/12, 09:45". -# Currently the order of these separators is not checked, so -# illogical formats such as "1965/07/12, : ,09:45" will also -# be matched. Otherwise, a time is only recognised as being associated -# with a date if there is only whitespace in between, or if the time -# was embedded in the date. -# -# Days of the week are not scanned, but will be ignored if they occur -# at the start of the date pattern only. -# -# For example, the standard date format: -# Fri Aug 18 17:00:48 BST 2006 -# is handled by matching HH:MM:SS and removing it together with the -# matched (but unused) time zone. This leaves the following: -# Fri Aug 18 2006 -# "Fri" is ignored and the rest is matched according to the sixth of -# the standard rules. -# -# Relative times -# ============== -# -# The option -r allows a relative time. Years (or ys, yrs, or without s), -# months (or mths, mons, mnths, months, or without s --- "m", "ms" and -# "mns" are ambiguous and are not handled), weeks (or ws, wks, or without -# s) and days (or ds, dys, days, or without s), hours (or hs, hrs, with or -# without s), minutes (or mins, with or without s) and seconds (or ss, -# secs, with or without s) are understood. Spaces between the numbers -# are optional, but are required between items, although a comma -# may be used (with or without spaces). -# -# Note that a year here is 365.25 days and a month is 30 days. -# -# With -R start_time, a relative time is parsed and start_time is treated -# as the start of the period. This allows months and years to be calculated -# accurately. If the option -m (minus) is also given the relative time is -# taken backwards from the start time. -# -# This allows forms like: -# 30 years 3 months 4 days 3:42:41 -# 14 days 5 hours -# 4d,10hr -# In this case absolute dates are ignored. - -emulate -L zsh -setopt extendedglob # xtrace - -zmodload -i zsh/datetime || return 1 - -# separator characters before time or between time and date -# allow , - or : before the time: this allows spaceless but still -# relatively logical dates like 2006/09/19:14:27 -# don't allow / before time ! the above -# is not 19 hours 14 mins and 27 seconds after anything. -local tschars="[-,:[:blank:]]" -# start pattern for time when anchored -local tspat_anchor="(${tschars}#)" -# ... when not anchored -local tspat_noanchor="(|*${tschars})" -# separator characters between elements. comma is fairly -# natural punctuation; otherwise only allow whitespace. -local schars="[.,[:space:]]" -local -a dayarr -dayarr=(sun mon tue wed thu fri sat) -local daypat="${schars}#((#B)(${(j.|.)dayarr})[a-z]#~month*)" -# Start pattern for date: treat , as space for simplicity. This -# is illogical at the start but saves lots of minor fiddling later. -# Date start pattern when anchored at the start. -# We need to be able to ignore the day here, although (for consistency -# with the unanchored case) we don't remove it until later. -# (The problem in the other case is that matching anything before -# the day of the week is greedy, so the day of the week gets ignored -# if it's optional.) -local dspat_anchor="(|(#B)(${daypat}|)(#b)${schars}#)" -local dspat_anchor_noday="(|${schars}#)" -# Date start pattern when not anchored at the start. -local dspat_noanchor="(|*${schars})" -# end pattern for relative times: similar remark about use of $schars. -local repat="(|s)(|${schars}*)" -# not locale-dependent! I don't know how to get the months out -# of the system for the purpose of finding out where they occur. -# We may need some completely different heuristic. -local monthpat="(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]#" -integer daysecs=$(( 24 * 60 * 60 )) -local d="[[:digit:]]" - -integer year year2 month month2 day day2 hour minute second then nth wday wday2 -local opt line orig_line mname MATCH MBEGIN MEND tz test rest_line -local -a match mbegin mend -# Flags that we found a date or a time (maybe a relative time) -integer date_found time_found -# Flag that it's OK to have a time only -integer time_ok -# Indices of positions of start and end of time and dates found. -# These are actual character indices as zsh would normally use, i.e. -# line[time_start,time_end] is the string for the time. -integer time_start time_end date_start date_end -integer anchor anchor_end debug setvar -integer relative relative_start reladd reldate relsign=1 newadd h1 h2 hd - -while getopts "aAdmrR:st" opt; do - case $opt in - (a) - # anchor - (( anchor = 1 )) - ;; - - (A) - # anchor at end, too - (( anchor = 1, anchor_end = 1 )) - ;; - - (d) - # enable debug output - (( debug = 1 )) - ;; - - (m) - # relative with negative offsets - (( relsign = -1 )) - ;; - - (r) - # relative with no fixed start - (( relative = 1 )) - ;; - - (R) - # relative with fixed start supplied - (( relative_start = OPTARG, relative = 2 )) - ;; - - (s) - (( setvar = 1 )) - ;; - - (t) - (( time_ok = 1 )) - ;; - - (*) - return 1 - ;; - esac -done -shift $(( OPTIND - 1 )) - -line=$1 - -local dspat dspat_noday tspat -if (( anchor )); then - # Anchored at the start. - dspat=$dspat_anchor - dspat_noday=$dspat_anchor_noday - if (( relative )); then - tspat=$tspat_anchor - else - # We'll test later if the time is associated with the date. - tspat=$tspat_noanchor - fi - # We can save a huge amount of grief (I've discovered) if when - # we're anchored to the start we ignore anything after a newline. - # However, don't do this if we're anchored to the end. The - # match should fail if there are extra lines in that case. - if [[ anchor_end -eq 0 && $line = (#b)([^$'\n']##)($'\n'*) ]]; then - line=$match[1] - rest_line=$match[2] - fi -else - dspat=$dspat_noanchor - dspat_noday=$dspat_noanchor - tspat=$tspat_noanchor -fi -orig_line=$line - -# Look for a time separately; we need colons for this. -# We want to look for the first time to ensure it's associated -# with a date at the start of the line. Of course there may be -# a time followed by some other text followed by a date, but -# in that case the whole thing is too ambiguous to worry about -# (and we don't need to worry about this for a calendar entry where -# the date must be at the start). -# -# We do this by minimal matching at the head, i.e. ${...#...}. -# To use a case statement we'd need to be able to request non-greedy -# matching for a pattern. -local rest -# HH:MM:SECONDS am/pm with optional decimal seconds -rest=${line#(#ibm)${~tspat}(<0-12>):(<0-59>)[.:]((<0-59>)(.<->|))[[:space:]]#([ap])(|.)[[:space:]]#m(.|[[:space:]]|(#e))} -if [[ $rest != $line ]]; then - hour=$match[2] - minute=$match[3] - second=$match[5] - [[ $match[7] = (#i)p ]] && (( hour <= 12 )) && (( hour += 12 )) - time_found=1 -fi -if (( time_found == 0 )); then - # no seconds, am/pm - rest=${line#(#ibm)${~tspat}(<0-12>):(<0-59>)[[:space:]]#([ap])(|.)[[:space:]]#m(.|[[:space:]]|(#e))} - if [[ $rest != $line ]]; then - hour=$match[2] - minute=$match[3] - [[ $match[4] = (#i)p ]] && (( hour <= 12 )) && (( hour += 12 )) - time_found=1 - fi -fi -if (( time_found == 0 )); then - # no colon, even, but a.m./p.m. indicator - rest=${line#(#ibm)${~tspat}(<0-12>)[[:space:]]#([ap])(|.)[[:space:]]#m(.|[[:space:]]|(#e))} - if [[ $rest != $line ]]; then - hour=$match[2] - minute=0 - [[ $match[3] = (#i)p ]] && (( hour <= 12 )) && (( hour += 12 )) - time_found=1 - fi -fi -if (( time_found == 0 )); then - # 24 hour clock, with seconds - rest=${line#(#ibm)${~tspat}(<0-24>):(<0-59>)[.:]((<0-59>)(.<->|))(.|[[:space:]]|(#e))} - if [[ $rest != $line ]]; then - hour=$match[2] - minute=$match[3] - second=$match[5] - time_found=1 - fi -fi -if (( time_found == 0 )); then - rest=${line#(#ibm)${~tspat}(<0-24>):(<0-59>)(.|[[:space:]]|(#e))} - if [[ $rest != $line ]]; then - hour=$match[2] - minute=$match[3] - time_found=1 - fi -fi -if (( time_found == 0 )); then - # Combined date and time formats: here we can use an anchor because - # we know the complete format. - (( anchor )) && tspat=$tspat_anchor - # RFC 2445 - rest=${line#(#ibm)${~tspat}(|\"[^\"]##\":)($~d$~d$~d$~d)($~d$~d)($~d$~d)T($~d$~d)($~d$~d)($~d$~d)([[:space:]]#|(#e))} - if [[ $rest != $line ]]; then - year=$match[3] - month=$match[4] - day=$match[5] - hour=$match[6] - minute=$match[7] - second=$match[8] - # signal don't need to take account of time in date... - time_found=2 - date_found=1 - date_start=$mbegin[3] - date_end=$mend[-1] - fi -fi -(( hour == 24 )) && hour=0 - -if (( time_found && ! date_found )); then - # time was found; if data also found already, process below. - time_start=$mbegin[2] - time_end=$mend[-1] - # Remove the timespec because it may be in the middle of - # the date (as in the output of "date". - # There may be a time zone, too, which we don't yet handle. - # (It's not in POSIX strptime() and libraries don't support it well.) - # This attempts to remove some of the weirder forms. - if [[ $line[$time_end+1,-1] = (#b)[[:space:]]#([A-Z][A-Z][A-Z]|[-+][0-9][0-9][0-9][0-9])([[:space:]]|(#e))* || \ - $line[$time_end+1,-1] = (#b)[[:space:]]#([A-Z][A-Z][A-Z](|[-+])<0-12>)([[:space:]]|(#e))* || \ - $line[$time_end+1,-1] = (#b)[[:space:]]#([A-Z][A-Z][A-Z](|[-+])<0-12>[A-Z][A-Z][A-Z])([[:space:]]|(#e))* ]]; then - (( time_end += ${mend[-1]} )) - tz=$match[1] - fi - line=$line[1,time_start-1]$line[time_end+1,-1] - (( debug )) && print "line after time: $line" -fi - -if (( relative == 0 && date_found == 0 )); then - # Date. - case $line in - # Look for YEAR[-/.]MONTH[-/.]DAY - ((#bi)${~dspat}((19|20)[0-9][0-9])[-/](<1-12>)[-/](<1-31>)*) - year=$match[2] - month=$match[4] - day=$match[5] - date_start=$mbegin[2] date_end=$mend[5] - date_found=1 - ;; - - # Same with month name - ((#bi)${~dspat}((19|20)[0-9][0-9])[-/]${~monthpat}[-/](<1-31>)*) - year=$match[2] - mname=$match[4] - day=$match[5] - date_start=$mbegin[2] date_end=$mend[5] - date_found=1 - ;; - - # Look for DAY[th/st/nd/rd] MNAME[,] YEAR - ((#bi)${~dspat}(<1-31>)(|th|st|nd|rd)[[:space:]]##${~monthpat}(|,)[[:space:]]##((19|20)[0-9][0-9])*) - day=$match[2] - mname=$match[4] - year=$match[6] - date_start=$mbegin[2] date_end=$mend[6] - date_found=1 - ;; - - # Look for MNAME DAY[th/st/nd/rd][,] YEAR - ((#bi)${~dspat}${~monthpat}[[:space:]]##(<1-31>)(|th|st|nd|rd)(|,)[[:space:]]##((19|20)[0-9][0-9])*) - mname=$match[2] - day=$match[3] - year=$match[6] - date_start=$mbegin[2] date_end=$mend[6] - date_found=1 - ;; - - # Look for DAY[th/st/nd/rd] MNAME; assume current year - ((#bi)${~dspat}(<1-31>)(|th|st|nd|rd)[[:space:]]##${~monthpat}(|,)([[:space:]]##*|)) - day=$match[2] - mname=$match[4] - strftime -s year "%Y" $EPOCHSECONDS - date_start=$mbegin[2] date_end=$mend[5] - date_found=1 - ;; - - # Look for MNAME DAY[th/st/nd/rd]; assume current year - ((#bi)${~dspat}${~monthpat}[[:space:]]##(<1-31>)(|th|st|nd|rd)(|,)([[:space:]]##*|)) - mname=$match[2] - day=$match[3] - strftime -s year "%Y" $EPOCHSECONDS - date_start=$mbegin[2] date_end=$mend[5] - date_found=1 - ;; - - # Now it gets a bit ambiguous. - # Look for DAY[th/st/nd/rd][/]MONTH[/ ,]YEAR - ((#bi)${~dspat}(<1-31>)(|th|st|nd|rd)/(<1-12>)((|,)[[:space:]]##|/)((19|20)[0-9][0-9])*) - day=$match[2] - month=$match[4] - year=$match[7] - date_start=$mbegin[2] date_end=$mend[7] - date_found=1 - ;; - - # Look for MONTH[/]DAY[th/st/nd/rd][/ ,]YEAR - ((#bi)${~dspat}(<1-12>)/(<1-31>)(|th|st|nd|rd)((|,)[[:space:]]##|/)((19|20)[0-9][0-9])*) - month=$match[2] - day=$match[3] - year=$match[7] - date_start=$mbegin[2] date_end=$mend[7] - date_found=1 - ;; - - # Look for WEEKDAY - ((#bi)${~dspat_noday}(${~daypat})(|${~schars})*) - integer wday_now wday - local wdaystr=${(L)match[3]} - date_start=$mbegin[2] date_end=$mend[2] - - # Find the day number. - local -a wdays - # This is the ordering of %w in strtfime (zero-offset). - wdays=(sun mon tue wed thu fri sat sun) - (( wday = ${wdays[(i)$wdaystr]} - 1 )) - - # Find the date for that day. - (( then = EPOCHSECONDS )) - strftime -s wday_now "%w" $then - # Day is either today or in the past. - (( wday_now < wday )) && (( wday_now += 7 )) - (( then -= (wday_now - wday) * 24 * 60 * 60 )) - strftime -s year "%Y" $then - strftime -s month "%m" $then - strftime -s day "%d" $then - date_found=1 - ;; - - # Look for "today", "yesterday", "tomorrow" - ((#bi)${~dspat_noday}(yesterday|today|tomorrow|now)(|${~schars})*) - (( then = EPOCHSECONDS )) - case ${(L)match[2]} in - (yesterday) - (( then -= daysecs )) - ;; - - (tomorrow) - (( then += daysecs )) - ;; - - (now) - time_found=1 time_end=0 time_start=1 - strftime -s hour "%H" $then - strftime -s minute "%M" $then - strftime -s second "%S" $then - ;; - esac - strftime -s year "%Y" $then - strftime -s month "%m" $then - strftime -s day "%d" $then - date_start=$mbegin[2] date_end=$mend[2] - date_found=1 - ;; - esac -fi - -if (( date_found || (time_ok && time_found) )); then - # date found - # see if there's a day at the start - if (( date_found )); then - if [[ ${line[1,$date_start-1]} = (#bi)${~daypat}${~schars}# ]]; then - date_start=$mbegin[1] - fi - line=${line[1,$date_start-1]}${line[$date_end+1,-1]} - fi - if (( time_found == 1 )); then - if (( date_found )); then - # If we found a time, it must be associated with the date, - # or we can't use it. Since we removed the time from the - # string to find the date, however, it's complicated to - # know where both were found. Reconstruct the date indices of - # the original string. - if (( time_start <= date_start )); then - # Time came before start of date; add length in. - (( date_start += time_end - time_start + 1 )) - fi - if (( time_start <= date_end )); then - (( date_end += time_end - time_start + 1 )) - fi - - if (( time_end + 1 < date_start )); then - # If time wholly before date, OK if only separator characters - # in between. (This allows some illogical stuff with commas - # but that's probably not important.) - if [[ ${orig_line[time_end+1,date_start-1]} != ${~schars}# ]]; then - # Clearly this can't work if anchor is set. In principle, - # we could match the date and ignore the time if it wasn't. - # However, that seems dodgy. - return 1 - else - # Form massaged line by removing the entire date/time chunk. - line="${orig_line[1,time_start-1]}${orig_line[date_end+1,-1]}" - fi - elif (( date_end + 1 < time_start )); then - # If date wholly before time, OK if only time separator characters - # in between. This allows 2006/10/12:13:43 etc. - if [[ ${orig_line[date_end+1,time_start-1]} != ${~tschars}# ]]; then - # Here, we assume the time is associated with something later - # in the line. This is pretty much inevitable for the sort - # of use we are expecting. For example, - # 2006/10/24 Meeting from early, may go on till 12:00. - # or with some uses of the calendar system, - # 2006/10/24 MR 1 Another pointless meeting WARN 01:00 - # The 01:00 says warn an hour before, not that the meeting starts - # at 1 am. About the only safe way round would be to force - # a time to be present, but that's not how the traditional - # calendar programme works. - # - # Hence we need to reconstruct. - (( time_found = 0, hour = 0, minute = 0, second = 0 )) - line="${orig_line[1,date_start-1]}${orig_line[date_end+1,-1]}" - else - # As above. - line="${orig_line[1,date_start-1]}${orig_line[time_end+1,-1]}" - fi - fi - else - # Time only. - # We didn't test anchors for time originally, since it - # might have been embedded in the date. If there's no date, - # we need to test specially. - if (( anchor )) && - [[ ${orig_line[1,time_start-1]} != ${~tschars}# ]]; then - # Anchor at start failed. - return 1 - fi - strftime -s year "%Y" $EPOCHSECONDS - strftime -s month "%m" $EPOCHSECONDS - strftime -s day "%d" $EPOCHSECONDS - # Date now handled. - (( date_found = 1 )) - fi - if (( debug )); then - print "Time string: $time_start,$time_end:" \ - "'$orig_line[time_start,time_end]'" - (( date_ok )) && print "Date string: $date_start,$date_end:" \ - "'$orig_line[date_start,date_end]'" - print "Remaining line: '$line$rest_line'" - fi - fi -fi - -if (( relative )); then - if (( relative == 2 )); then - # Relative years and months are variable, and we may need to - # be careful about days. - strftime -s year "%Y" $relative_start - strftime -s month "%m" $relative_start - strftime -s day "%d" $relative_start - strftime -rs then "%Y:%m:%d" "${year}:${month}:${day}" - fi - if [[ $line = (#bi)${~dspat}(<->|)[[:space:]]#(y|yr|year|yearly)${~repat} ]]; then - [[ -z $match[2] ]] && match[2]=1 - if (( relative == 2 )); then - # We need the difference between relative_start & the - # time ${match[2]} years later. This means keeping the month and - # day the same and changing the year. - (( year2 = year + relsign * ${match[2]} )) - strftime -rs reldate "%Y:%m:%d" "${year2}:${month}:${day}" - - # If we've gone from a leap year to a non-leap year, go back a day. - strftime -s month2 "%m" $reldate - (( month2 != month )) && (( reldate -= daysecs )) - - # Keep this as a difference for now since we may need to add in other stuff. - (( reladd += reldate - then )) - else - (( reladd += relsign * ((365*4+1) * daysecs * ${match[2]} + 1) / 4 )) - fi - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi - if [[ $line = (#bi)${~dspat}(<->|)[[:space:]]#(mth|mon|mnth|month|monthly)${~repat} ]]; then - [[ -z $match[2] ]] && match[2]=1 - if (( relative == 2 )); then - # Need to add on ${match[2]} months as above. - (( month2 = month + relsign * ${match[2]} )) - if (( month2 <= 0 )); then - # going backwards beyond start of given year - (( year2 = year + month2 / 12 - 1, month2 = month2 + (year-year2)*12 )) - else - (( year2 = year + (month2 - 1)/ 12, month2 = (month2 - 1) % 12 + 1 )) - fi - strftime -rs reldate "%Y:%m:%d" "${year2}:${month2}:${day}" - - # If we've gone past the end of the month because it was too short, - # we have two options (i) get the damn calendar fixed (ii) wind - # back to the end of the previous month. (ii) is easier for now. - if (( day > 28 )); then - while true; do - strftime -s day2 "%d" $reldate - # There are only up to 3 days in it, so just wind back one at a - # time. Saves counting. - (( day2 >= 28 )) && break - (( reldate -= daysecs )) - done - fi - - (( reladd += reldate - then )) - else - (( reladd += relsign * 30 * daysecs * ${match[2]} )) - fi - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi - # For the next three items we accumulate adjustments in "newadd". - # See note below for why they are special. - if [[ $relative = 2 && $line = (#bi)${~dspat_noday}(<->)(th|rd|nd|st)(${~daypat})(|${~schars}*) ]]; then - nth=$match[2] - test=${(L)${${match[4]##${~schars}#}%%${~schars}#}[1,3]} - wday=${dayarr[(I)$test]} - if (( wday )); then - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - # We want weekday 0 to 6 - (( wday-- )) - (( reldate = relative_start + reladd )) - strftime -s year2 "%Y" $reldate - strftime -s month2 "%m" $reldate - # Find day of week of the first of the month we've landed on. - strftime -rs then "%Y:%m:%d" "${year2}:${month2}:1" - strftime -s wday2 "%w" $then - # Calculate day of month - (( day = 1 + (wday - wday2) + (nth - 1) * 7 )) - (( wday < wday2 )) && (( day += 7 )) - # whereas the day of the month calculated so far is... - strftime -s day2 "%d" $reldate - # so we need to compensate by... - (( newadd += (day - day2) * daysecs )) - fi - fi - if [[ $line = (#bi)${~dspat}(<->|)[[:space:]]#(w|wk|week|weekly)${~repat} ]]; then - [[ -z $match[2] ]] && match[2]=1 - (( newadd += relsign * 7 * daysecs * ${match[2]} )) - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi - if [[ $line = (#bi)${~dspat}(<->|)[[:space:]]#(d|dy|day|daily)${~repat} ]]; then - [[ -z $match[2] ]] && match[2]=1 - (( newadd += relsign * daysecs * ${match[2]} )) - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi - if (( relative == 2 && newadd )); then - # You thought a day was always the same time? Ho, ho, ho. - # If the clocks go forward or back, we can gain or lose - # an hour. Check this by seeing what the hour is before - # and after adding the number of days. If it changes, - # remove the difference. - # - # We need this correction for days (including days of a given - # month) and weeks. - # We don't need it for years and months because we calculated - # those by actually looking at the calendar for a given - # time of day, so the adjustment came out in the wash. - # We don't need it for hours or smaller periods because - # presumably if a user asks for something in 3 hours time - # they don't mean 4 hours if the clocks went back and - # 2 hours if they went forward. At least, I think so. - # Consider: - # % calendar_showdate +2d,1hr - # Sun Mar 25 00:37:00 GMT 2007 - # % calendar_showdate +2d,2hr - # Sun Mar 25 02:37:09 BST 2007 - # At first sight that looks wrong because the clock appears - # to jump two hours. (Yes, it took me all of 9 seconds to - # edit the line.) But actually it's only jumped the hour - # you asked for, because one is in GMT and the other in BST. - # In principle you could say the same thing about days: - # Sun Mar 25 00:00:00 GMT 2007 and Mon Mar 26 01:00:00 BST 2007 - # are a day apart. But usually if you say "same time next Tuesday" - # you mean "when the clock says the same time, even if someone - # has nipped in and adjusted it in the mean time", although - # for some reason you don't usually bother saying that. - # - # Hope that's clear. - strftime -s h1 "%H" $(( relative_start + reladd )) - strftime -s h2 "%H" $(( relative_start + reladd + newadd )) - (( hd = h2 - h1 )) - # and of course we might go past midnight... - if (( hd > 12 )); then - (( hd -= 24 )) - elif (( hd < -12 )); then - (( hd += 24 )) - fi - (( newadd -= hd * 3600 )) - fi - (( reladd += newadd )) - if [[ $line = (#bi)${~dspat}(<->|)[[:space:]]#(h|hr|hour|hourly)${~repat} ]]; then - [[ -z $match[2] ]] && match[2]=1 - (( reladd += relsign * 60 * 60 * ${match[2]} )) - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi - if [[ $line = (#bi)${~dspat}(<->)[[:space:]]#(min|minute)${~repat} ]]; then - (( reladd += relsign * 60 * ${match[2]} )) - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi - if [[ $line = (#bi)${~dspat}(<->)[[:space:]]#(s|sec|second)${~repat} ]]; then - (( reladd += relsign * ${match[2]} )) - line=${line[1,$mbegin[2]-1]}${line[$mend[4]+1,-1]} - time_found=1 - fi -fi - -if (( relative )); then - # If no date was found, we're in trouble unless we found a time. - if (( time_found )); then - if (( anchor_end )); then - # must be left with only separator characters - if [[ $line != ${~schars}# ]]; then - return 1 - fi - fi - # relative_start is zero if we're not using it - (( reladd += (hour * 60 + minute) * 60 + second )) - typeset -g REPLY - (( REPLY = relative_start + reladd )) - [[ -n $setvar ]] && typeset -g REPLY2="$line$rest_line" - return 0 - fi - return 1 -elif (( date_found == 0 )); then - return 1 -fi - -if (( anchor_end )); then - # must be left with only separator characters - if [[ $line != ${~schars}# ]]; then - return 1 - fi -fi - -local fmt nums -if [[ -n $mname ]]; then - fmt="%Y %b %d %H %M %S" - nums="$year $mname $day $hour $minute $second" -else - fmt="%Y %m %d %H %M %S" - nums="$year $month $day $hour $minute $second" -fi - -strftime -s REPLY -r $fmt $nums - -[[ -n $setvar ]] && typeset -g REPLY2="$line$rest_line" - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_show b/zsh_arm64/system/usr/share/zsh/functions/calendar_show deleted file mode 100644 index 0e236fd..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_show +++ /dev/null @@ -1,36 +0,0 @@ -integer start=$1 stop=$2 -shift 2 - -[[ -o zle ]] && zle -I -print -r "$*" - -local -a cmd -zmodload -i zsh/parameter || return - -# Use xmessage to display the message if the start and stop time -# are the same, indicating we have been scheduled to display it. -# Don't do this if there's already an notification/message for the same user. -# HERE: this should be configurable and we should be able to do -# better if xmessage isn't available, e.g. wish. -if [[ -n $DISPLAY && $start -eq $stop ]]; then - if [[ -n ${commands[kdialog]} && -n $KDE_SESSION_UID ]] - then - # We're in a KDE session, most probably. - # Simple: - cmd=(kdialog --msgbox) - # Alternative: - # calendar_knotify_show() { - # dcop knotify default notify calendar zsh "$*" '' '' 2 0 - # } - # cmd=(calendar_knotify_show) - elif [[ -n ${commands[xmessage]} ]]; then - cmd=(xmessage -center) - fi - if [[ -n $cmd[1] ]] && - ! ps -u$UID | grep $cmd[1] >/dev/null 2>&1; then - # turn off job control for this - ($cmd "$*" &) - fi -fi - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_showdate b/zsh_arm64/system/usr/share/zsh/functions/calendar_showdate deleted file mode 100644 index a898551..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_showdate +++ /dev/null @@ -1,77 +0,0 @@ -emulate -L zsh -setopt extendedglob -zmodload -i zsh/datetime - -local optm datefmt opt -integer optr replyset - -zstyle -s ':datetime:calendar_showdate:' date-format datefmt || - datefmt="%a %b %d %H:%M:%S %Z %Y" - -# Memo to myself: both + and - are documented as giving relative -# times, so it's not a good idea to rewrite this to use getopts. -# We need to detect the small number of options this can actually -# handle. -while [[ $1 = -r || $1 = -- || $1 = -f* ]]; do - case $1 in - (-r) - shift - REPLY=0 - optr=1 - ;; - - (-f*) - if [[ $1 = -f?* ]]; then - datefmt=$1[3,-1] - shift - else - shift - if [[ -z $1 || $1 != *%* ]]; then - print "$0: -f requires a date/time specification" >&2 - return 1 - fi - datefmt=$1 - shift - fi - ;; - - (--) - shift - break - ;; - esac -done - -(( optr )) || local REPLY - -if (( ! $# )); then - print "Usage: $0 datespec [ ... ]" >&2 - return 1 -fi - -while (( $# )); do - optm= - if [[ $1 = [-+]* ]]; then - # relative - [[ $1 = -* ]] && optm=-m - 1=${1[2,-1]} - # if this is the first argument, use current time - # don't make assumptions about type of reply in case global - if (( ! replyset )); then - REPLY=$EPOCHSECONDS - replyset=1 - fi - fi - - if (( replyset )); then - calendar_scandate $optm -R $REPLY -aA $1 || return 1 - replyset=1 - else - calendar_scandate -aA $1 || return 1 - fi - - shift -done - -(( optr )) && return -strftime $datefmt $REPLY diff --git a/zsh_arm64/system/usr/share/zsh/functions/calendar_sort b/zsh_arm64/system/usr/share/zsh/functions/calendar_sort deleted file mode 100644 index 171d4f9..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/calendar_sort +++ /dev/null @@ -1,77 +0,0 @@ -emulate -L zsh -setopt extendedglob - -autoload -Uz calendar_{read,scandate,lockfiles} - -local calendar line REPLY new lockfile -local -a calendar_entries -local -a times lines_sorted lines_unsorted lines_failed lockfiles -integer i - -# Read the calendar file from the calendar-file style -zstyle -s ':datetime:calendar:' calendar-file calendar || calendar=~/calendar - -# start of subshell for OS file locking -( -# start of block for following always to clear up lockfiles. -# Not needed but harmless if OS file locking is used. -{ - if zmodload -F zsh/system b:zsystem && zsystem supports flock && - zsystem flock $calendar; then - # locked OK - : - else - calendar_lockfiles $calendar || exit 1 - fi - - new=$calendar.new.$$ - calendar_read $calendar - if [[ ${#calendar_entries} -eq 0 || \ - ( ${#calendar_entries} -eq 1 && -z $calendar_entries[1] ) ]]; then - return 0 - fi - - for line in $calendar_entries; do - if calendar_scandate -a $line; then - lines_unsorted+=("${(l.16..0.)REPLY}:$line") - else - lines_failed+=($line) - fi - done - - if (( ${#lines_unsorted} )); then - lines_sorted=(${${(o)lines_unsorted}##[0-9]##:}) - fi - - { - for line in "${lines_failed[@]}"; do - print "$line # BAD DATE" - done - (( ${#lines_sorted} )) && print -l "${lines_sorted[@]}" - } > $new - - if [[ ! -s $new ]]; then - print "Writing to $new failed." - return 1 - elif (( ${#lines_failed} )); then - print "Warning: lines with date that couldn't be parsed. -Output (with unparseable dates marked) left in $new" - return 1 - fi - - if ! mv $calendar $calendar.old; then - print "Couldn't back-up $calendar to $calendar.old. -New calendar left in $new" - return 1 - fi - if ! mv $new $calendar; then - print "Failed to rename $new to $calendar. -Old calendar left in $calendar.old" - return 1 - fi - - print "Old calendar left in $calendar.old" -} always { - (( ${#lockfiles} )) && rm -rf $lockfiles -} -) diff --git a/zsh_arm64/system/usr/share/zsh/functions/capitalize-word-match b/zsh_arm64/system/usr/share/zsh/functions/capitalize-word-match deleted file mode 100644 index aa25b8e..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/capitalize-word-match +++ /dev/null @@ -1,23 +0,0 @@ -emulate -L zsh -setopt extendedglob - -autoload match-words-by-style - -local curcontext=":zle:$WIDGET" word -local -a matched_words -integer count=${NUMERIC:-1} - -while (( count-- > 0 )); do - match-words-by-style - - word=${(j..)matched_words[4,5]} - - if [[ -n $word ]]; then - LBUFFER+=${(C)word} - RBUFFER=${(j..)matched_words[6,7]} - else - return 1 - fi -done - -return 0 diff --git a/zsh_arm64/system/usr/share/zsh/functions/catch b/zsh_arm64/system/usr/share/zsh/functions/catch deleted file mode 100644 index 6afd664..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/catch +++ /dev/null @@ -1,41 +0,0 @@ -# Catch an exception. Returns 0 if the exception in question was caught. -# The first argument gives the exception to catch, which may be a -# pattern. -# This must be within an always-block. A typical set of handlers looks -# like: -# { -# # try block; something here throws exceptions -# } always { -# if catch MyExcept; then -# # Handler code goes here. -# print Handling exception MyExcept -# elif catch *; then -# # This is the way to implement a catch-all. -# print Handling any other exception -# fi -# } -# As with other languages, exceptions do not need to be handled -# within an always block and may propagate to a handler further up the -# call chain. -# -# It is possible to throw an exception from within the handler by -# using "throw". -# -# The shell variable $CAUGHT is set to the last exception caught, -# which is useful if the argument to "catch" was a pattern. -# -# Use "function" keyword in case catch is already an alias. -function catch { - if [[ $TRY_BLOCK_ERROR -gt 0 && $EXCEPTION = ${~1} ]]; then - (( TRY_BLOCK_ERROR = 0 )) - typeset -g CAUGHT="$EXCEPTION" - unset EXCEPTION - return 0 - fi - - return 1 -} -# Never use globbing with "catch". -alias catch="noglob catch" - -catch "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/cdr b/zsh_arm64/system/usr/share/zsh/functions/cdr deleted file mode 100644 index 4bed88b..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/cdr +++ /dev/null @@ -1,336 +0,0 @@ -# Description -# =========== -# -# Change to a recently used directory recorded in a file so that the -# recent file list persists across sessions. -# -# To use this system, -# -# autoload -Uz chpwd_recent_dirs cdr add-zsh-hook -# add-zsh-hook chpwd chpwd_recent_dirs -# -# (add-zsh-hook appeared in zsh version 4.3.4.) This ensures that all -# directories you change to interactively are registered. The -# chpwd_recent_dirs function does some guesswork to see if you are "really" -# changing directory permanently, see below. -# -# The argument to cdr is a number corresponding to the Nth most recently -# changed-to directory starting at 1 for the immediately preceding -# directory (the current directory is remembered but is not offered as a -# destination). You can use directory arguments if you set the -# recent-dirs-default style, see below; however, it should be noted -# that if you do you gain nothing over using cd directly (the recent -# directory list is updated in either case). -# -# If the argument is omitted, 1 is assumed. -# -# Completion is available if compinit has been run; menu selection is -# recommended, using -# -# zstyle ':completion:*:*:cdr:*:*' menu selection -# -# and also the verbose style to ensure the directory is shown (this -# is on by default). -# -# Options -# ======= -# -# "cdr -l" lists the numbers and the corresponding directories in -# abbreviated form (i.e. with "~" substitution reapplied), one per line. -# The directories here are not quoted (this would only be an issue if a -# directory name contained a newline). This is used by the completion -# system. -# -# "cdr -r" sets the parameter "reply" to the current set of directories. -# -# "cdr -e" allows you to edit the list of directories, one per line. The -# list can be edited to any extent you like; no sanity checking is -# performed. Completion is available. No quoting is necessary (except for -# newlines, where I have in any case no sympathy); directories are in -# unabbreviated from and contain an absolute path, i.e. they start with / -# (and only /). Usually the first entry should be left as the current -# directory. -# -# "cdr -p 'pattern'" prunes anything matching the given extended glob -# pattern from the directory list. The match is against the fully -# expanded directory path and the full string must match (use wildcards -# at the ends if needed). If output is going to a terminal, the -# function will print the new list for the user to confrim; this can be -# skipped by giving -P instead of -p. -# -# Details of directory handling -# ============================= -# -# Recent directories are saved to a file immediately and hence are -# preserved across sessions. Note currently no file locking is applied: -# the list is updated immediately on interactive commands and nowhere else -# (unlike history), and it is assumed you are only going to change -# directory in one window at once. This is not safe on shared accounts, -# but in any case the system has limited utility when someone else is -# changing to a different set of directories behind your back. -# -# To make this a little safer, only directory changes instituted from the -# command line, either directly or indirectly through shell function calls -# (but not through subshells, evals, traps, completion functions and the -# like) are saved. This works best in versions of the shell from 4.3.11 -# which has facilities to check the evaluation context. Shell functions -# should use cd -q or pushd -q to avoid side effects if the change to the -# directory is to be invisible at the command line. See the function -# chpwd_recent_dirs for more details. -# -# Styles -# ====== -# -# Various styles are available. The context for setting styles should be -# ':chpwd:*' in case the meaning of the context is extended in future, for -# example: -# -# zstyle ':chpwd:*' recent-dirs-max 0 -# -# although the style name is specific enough that a context of '*' should -# be fine in practice. The only exception is recent-dirs-insert, which is -# used exclusively by the completion system and so has the usual completion -# system context (':completion:*' if nothing more specific is needed, -# though again '*' should be fine in practice). -# -# recent-dirs-default -# If true, and the command is expecting a recent directory index, and -# either there is more than one argument or the argument is not an -# integer, then fall through to "cd". This allows the lazy to use only -# one command for directory changing. Completion recognises this, too; -# see recent-dirs-insert for how to control completion when this option -# is in use. -# -# recent-dirs-file -# The file where the list of directories is saved. The default -# is ${ZDOTDIR:-$HOME}/.chpwd-recent-dirs, i.e. this is in your -# home directory unless you have set ZDOTDIR to point somewhere else. -# Directory names are saved in $'...' quoted form, so each line -# in the file can be supplied directly to the shell as an argument. -# -# The value of this style may be an array. In this case, the first -# file in the list will always be used for saving directories while any -# other files are left untouched. When reading the recent directory -# list, if there are fewer than the maximum number of entries in the -# first file, the contents of later files in the array will be appended -# with duplicates removed from the list shown. The contents of the two -# files are not sorted together, i.e. all the entries in the first file -# are shown first. The special value "+" can appear in the list to -# indicate the default file should be read at that point. This allows -# effects like the following: -# -# zstyle recent-dirs-file ':chpwd:*' ~/.chpwd-recent-dirs-${TTY##*/} + -# -# Recent directories are read from a file numbered according to -# the terminal. If there are insufficient entries the list -# is supplemented from the default file. -# -# recent-dirs-insert -# Used by completion. If recent-dirs-default is true, then setting -# this to true causes the actual directory, rather than its index, to -# be inserted on the command line; this has the same effect as using -# the corresponding index, but makes the history clearer and the line -# easier to edit. With this setting, if part of an argument was -# already typed, normal directory completion rather than recent -# directory completion is done; this is because recent directory -# completion is expected to be done by cycling through entries menu -# fashion. However, if the value of the style is "always", then only -# recent directories will be completed; in that case, use the cd -# command when you want to complete other directories. If the value is -# "fallback", recent directories will be tried first, then normal -# directory completion is performed if recent directory completion -# failed to find a match. Finally, if the value is "both" then both -# sets of completions are presented; the usual tag mechanism can be -# used to distinguish results, with recent directories tagged as -# "recent-dirs". Note that the recent directories inserted are -# abbreviated with directory names where appropriate. -# -# recent-dirs-max -# The maximum number of directories to save to the file. If -# this is zero or negative there is no maximum. The default is 20. -# Note this includes the current directory, which isn't offered, -# so the highest number of directories you will be offered -# is one less than the maximum. -# -# recent-dirs-prune -# This style is an array determining what directories should (or should -# not) be added to the recent list. Elements of the array can include: -# parent -# Prune parents (more accurately, ancestors) from the recent list. -# If present, changing directly down by any number of directories -# causes the current directory to be overwritten. For example, -# changing from ~pws to ~pws/some/other/dir causes ~pws not to be -# left on the recent directory stack. This only applies to direct -# changes to descendant directories; earlier directories on the -# list are not pruned. For example, changing from ~pws/yet/another -# to ~pws/some/other/dir does not cause ~pws to be pruned. -# pattern: -# Gives a zsh pattern for directories that should not be -# added to the recent list (if not already there). This element -# can be repeated to add different patterns. For example, -# 'pattern:/tmp(|/*)' stops /tmp or its descendants from being -# added. The EXTENDED_GLOB option is always turned on for -# these patterns. -# -# recent-dirs-pushd -# If set to true, cdr will use pushd instead of cd to change the -# directory, so the directory is saved on the directory stack. As the -# directory stack is completely separate from the list of files saved -# by the mechanism used in this file there is no obvious reason to do -# this. -# -# Use with dynamic directory naming -# ================================= -# -# It is possible to refer to recent directories using the dynamic directory -# name syntax that appeared in zsh version 4.3.7. If you create and -# autoload a function zsh_directory_name containing the following code, -# ~[1] will refer to the most recent directory other than $PWD, and so on. -# This also includes completion (version 4.3.11 is required for this to -# work; previous versions needed the file _dynamic_directory_name to -# be overloaded). -# -# if [[ $1 = n ]]; then -# if [[ $2 = <-> ]]; then -# # Recent directory -# typeset -ga reply -# autoload -Uz cdr -# cdr -r -# if [[ -n ${reply[$2]} ]]; then -# reply=(${reply[$2]}) -# return 0 -# else -# reply=() -# return 1 -# fi -# fi -# elif [[ $1 = c ]]; then -# if [[ $PREFIX = <-> || -z $PREFIX ]]; then -# typeset -a keys values -# -# values=(${${(f)"$(cdr -l)"}/ ##/:}) -# keys=(${values%%:*}) -# -# _describe -t dir-index 'recent directory index' \ -# values keys -V unsorted -S']' -# return -# fi -# fi -# return 1 - - -emulate -L zsh -setopt extendedglob - -autoload -Uz chpwd_recent_filehandler chpwd_recent_add - -integer list set_reply i bad edit force_prune -local opt dir prune -local -aU dirs - -while getopts "elp:P:r" opt; do - case $opt in - (e) - edit=1 - ;; - - (l) - list=1 - ;; - - ([pP]) - prune=$OPTARG - edit=1 - [[ $opt = P ]] && force_prune=1 - ;; - - (r) - set_reply=1 - ;; - - (*) - return 1 - ;; - esac -done -shift $(( OPTIND - 1 )) - -if (( set_reply )); then - typeset -ga reply -else - local -a reply -fi - -if (( list || set_reply || edit )); then - (( $# )) && bad=1 -else - if [[ $#1 -eq 0 ]]; then - 1=1 - elif [[ $# -ne 1 || $1 != <-> ]]; then - if zstyle -t ':chpwd:' recent-dirs-default; then - cd "$@" - return - else - bad=1 - fi - fi -fi - -if (( bad )); then - print "Usage: $0 [-l | -r | ] -Use $0 -l or completion to see possible directories." - return 1 -fi - -chpwd_recent_filehandler - -if [[ $PWD != $reply[1] ]]; then - # When we first start we don't have the current directory. - # Add it now for consistency. - chpwd_recent_add $PWD && chpwd_recent_filehandler $reply -fi - -if (( edit )); then - if [[ -n $prune ]]; then - reply=(${reply:#$~prune}) - if [[ force_prune -eq 0 && -t 1 ]]; then - print -nrl "New list:" $reply 'Accept? ' - if ! read -q; then - print - return 1 - fi - print - fi - else - local compcontext='directories:directory:_path_files -/' - IFS=' -' vared reply || return 1 - fi - chpwd_recent_filehandler $reply -fi - -# Skip current directory if present (may have been pruned). -[[ $reply[1] = $PWD ]] && reply=($reply[2,-1]) - -if (( list )); then - dirs=($reply) - for (( i = 1; i <= ${#dirs}; i++ )); do - print -n ${(r.5.)i} - print -r ${(D)dirs[i]} - done - return -fi - -(( set_reply || edit )) && return - -if (( $1 > ${#reply} )); then - print "Not enough directories ($(( ${#dirs} - 1)) possibilities)" >&2 - return 1 -fi -dir=${reply[$1]} - -if zstyle -t ':chpwd:' recent-dirs-pushd; then - pushd -- $dir -else - cd -- $dir -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/checkmail b/zsh_arm64/system/usr/share/zsh/functions/checkmail deleted file mode 100755 index e3597bf..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/checkmail +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/zsh -# -# This autoloadable function checks the folders specified as arguments -# for new mails. The arguments are interpreted in exactly the same way -# as the mailpath special zsh parameter (see zshparam(1)). -# -# If no arguments are given mailpath is used. If mailpath is empty, $MAIL -# is used and if that is also empty, /var/spool/mail/$LOGNAME is used. -# This function requires zsh-3.0.1 or newer. -# - -emulate -L zsh -local file message - -for file in "${@:-${mailpath[@]:-${MAIL:-/var/spool/mail/$LOGNAME}}}" -do - message="${${(M)file%%\?*}#\?}" - file="${file%%\?*}" - if [[ -d "$file" ]] then - file=( "$file"/**/*(.ND) ) - if (($#file)) then - checkmail ${^file}\?$message - fi - elif test -s "$file" -a -N "$file"; then # this also sets $_ to $file - print -r -- "${(e)message:-You have new mail.}" - fi -done diff --git a/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_add b/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_add deleted file mode 100644 index 49ec8d1..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_add +++ /dev/null @@ -1,24 +0,0 @@ -# Helper for chpwd_recent_dirs. -# Add a directory to the reply array unless we're skipping it. -# If skipping, return non-zero status. - -local pat -local add=$1 -local -a prune patterns - -zstyle -a ':chpwd:' recent-dirs-prune prune -if (( ${#prune} )); then - patterns=(${${prune:#^pattern:*}##pattern:}) -fi - -for pat in $patterns; do - if [[ $add =~ ${~pat} ]]; then - return 1 - fi -done - -if [[ ${prune[(I)parent]} -ne 0 && $add = $reply[1]/* ]]; then - # replace - reply=($reply[2,-1]) -fi -reply=($add $reply) diff --git a/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_dirs b/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_dirs deleted file mode 100644 index 78608ee..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_dirs +++ /dev/null @@ -1,44 +0,0 @@ -# Save the current directory in the stack of most recently used directories. - -emulate -L zsh -setopt extendedglob - -local -aU reply -integer changed - -autoload -Uz chpwd_recent_filehandler chpwd_recent_add - -# Don't save if this is not interactive, or is in a subshell. -# Don't save if this is not being called directly from the top level -# of the shell via a straightforward sequence of shell functions. -# So this is called -# - on any straightforward cd or pushd (including AUTO_CD) -# - any time cd or pushd is called from a function invoked directly -# or indirectly from the command line, e.g. if pushd is a function -# fixing the order of directories that got broken years ago -# but it is not called any time -# - the shell is not interactive -# - we forked -# - we are being eval'd, including for some special purpose such -# as a style -# - we are not called from the top-level command loop, for example -# we are in a completion function (which is called from zle -# when the main top-level command interpreter isn't running) -# - obviously, when cd -q is in use (that's what the option is for). -# -# For compatibility with older shells, skip this test if $ZSH_EVAL_CONTEXT -# isn't set. This will never be the case inside a shell function when -# the variable is implemented. -if [[ ! -o interactive || $ZSH_SUBSHELL -ne 0 || \ - ( -n $ZSH_EVAL_CONTEXT && \ - $ZSH_EVAL_CONTEXT != toplevel(:[a-z]#func|)# ) ]]; then - return -fi - -chpwd_recent_filehandler - -if [[ $reply[1] != $PWD ]]; then - chpwd_recent_add $PWD && changed=1 - - (( changed )) && chpwd_recent_filehandler $reply -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_filehandler b/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_filehandler deleted file mode 100644 index 688612b..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/chpwd_recent_filehandler +++ /dev/null @@ -1,47 +0,0 @@ -# With arguments, output those files to the recent directory file. -# With no arguments, read in the directories from the file into $reply. -# -# Handles recent-dirs-file and recent-dirs-max styles. - -emulate -L zsh -setopt extendedglob - -integer max -local file line -local -a files dir -local default=${ZDOTDIR:-$HOME}/.chpwd-recent-dirs - -if zstyle -a ':chpwd:' recent-dirs-file files; then - files=(${files//(#s)+(#e)/$default}) -fi -if (( ${#files} == 0 )); then - files=($default) -fi - -zstyle -s ':chpwd:' recent-dirs-max max || max=20 - -if (( $# )); then - if (( max > 0 && ${#argv} > max )); then - argv=(${argv[1,max]}) - fi - # Quote on write. - # Use $'...' quoting... this fixes newlines and other nastiness. - print -rl ${(qqqq)argv} >${files[1]} -else - typeset -g reply - # Unquote on read. - reply=() - for file in $files; do - [[ -r $file ]] || continue - # Strip anything after the directory from the line. - # At the moment there isn't anything, but we'll make this - # future proof. - for line in ${(f)"$(<$file)"}; do - dir=(${(z)line}) - reply+=(${(Q)${dir[1]}}) - if (( max > 0 && ${#reply} == max )); then - break 2 - fi - done - done -fi diff --git a/zsh_arm64/system/usr/share/zsh/functions/colors b/zsh_arm64/system/usr/share/zsh/functions/colors deleted file mode 100644 index 027ca9a..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/colors +++ /dev/null @@ -1,117 +0,0 @@ -# Put standard ANSI color codes in shell parameters for easy use. -# Note that some terminals do not support all combinations. - -emulate -L zsh - -typeset -Ag color colour - -color=( -# Codes listed in this array are from ECMA-48, Section 8.3.117, p. 61. -# Those that are commented out are not widely supported or aren't closely -# enough related to color manipulation, but are included for completeness. - -# Attribute codes: - 00 none # 20 gothic - 01 bold # 21 double-underline - 02 faint 22 normal - 03 standout 23 no-standout - 04 underline 24 no-underline - 05 blink 25 no-blink -# 06 fast-blink # 26 proportional - 07 reverse 27 no-reverse - 08 conceal 28 no-conceal -# 09 strikethrough # 29 no-strikethrough - -# Font selection: -# 10 font-default -# 11 font-first -# 12 font-second -# 13 font-third -# 14 font-fourth -# 15 font-fifth -# 16 font-sixth -# 17 font-seventh -# 18 font-eighth -# 19 font-ninth - -# Text color codes: - 30 black 40 bg-black - 31 red 41 bg-red - 32 green 42 bg-green - 33 yellow 43 bg-yellow - 34 blue 44 bg-blue - 35 magenta 45 bg-magenta - 36 cyan 46 bg-cyan - 37 white 47 bg-white -# 38 iso-8316-6 # 48 bg-iso-8316-6 - 39 default 49 bg-default - -# Other codes: -# 50 no-proportional -# 51 border-rectangle -# 52 border-circle -# 53 overline -# 54 no-border -# 55 no-overline -# 56 through 59 reserved - -# Ideogram markings: -# 60 underline-or-right -# 61 double-underline-or-right -# 62 overline-or-left -# 63 double-overline-or-left -# 64 stress -# 65 no-ideogram-marking -) - -# A word about black and white: The "normal" shade of white is really a -# very pale grey on many terminals; to get truly white text, you have to -# use bold white, and to get a truly white background you have to use -# bold reverse white bg-xxx where xxx is your desired foreground color -# (and which means the foreground is also bold). - -# Map in both directions; could do this with e.g. ${(k)colors[(i)normal]}, -# but it's clearer to include them all both ways. - -local k -for k in ${(k)color}; do color[${color[$k]}]=$k; done - -# Add "fg-" keys for all the text colors, for clarity. - -for k in ${color[(I)3?]}; do color[fg-${color[$k]}]=$k; done - -# This is inaccurate, but the prompt theme system needs it. - -color[grey]=${color[black]} -color[fg-grey]=${color[grey]} -color[bg-grey]=${color[bg-black]} - -# Assistance for the color-blind. - -colour=(${(kv)color}) # A case where ksh namerefs would be useful ... - -# The following are terminal escape sequences used by colored prompt themes. - -local lc=$'\e[' rc=m # Standard ANSI terminal escape values - -typeset -Hg reset_color bold_color -reset_color="$lc${color[none]}$rc" -bold_color="$lc${color[bold]}$rc" - -# Foreground - -typeset -AHg fg fg_bold fg_no_bold -for k in ${(k)color[(I)fg-*]}; do - fg[${k#fg-}]="$lc${color[$k]}$rc" - fg_bold[${k#fg-}]="$lc${color[bold]};${color[$k]}$rc" - fg_no_bold[${k#fg-}]="$lc${color[normal]};${color[$k]}$rc" -done - -# Background - -typeset -AHg bg bg_bold bg_no_bold -for k in ${(k)color[(I)bg-*]}; do - bg[${k#bg-}]="$lc${color[$k]}$rc" - bg_bold[${k#bg-}]="$lc${color[bold]};${color[$k]}$rc" - bg_no_bold[${k#bg-}]="$lc${color[normal]};${color[$k]}$rc" -done diff --git a/zsh_arm64/system/usr/share/zsh/functions/compaudit b/zsh_arm64/system/usr/share/zsh/functions/compaudit deleted file mode 100644 index 93a0431..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/compaudit +++ /dev/null @@ -1,176 +0,0 @@ -# So that this file can also be read with `.' or `source' ... -compaudit() { # Define and then call - -# Audit the fpath to assure that it contains all the directories needed by -# the completion system, and that those directories are at least unlikely -# to contain dangerous files. This is far from perfect, as the modes or -# ownership of files or directories might change between the time of the -# audit and the time the function is executed. - -# This function is designed to be called from compinit, which assumes that -# it is in the same directory, i.e., it can be autoloaded from the initial -# fpath as compinit was. Most local parameter names in this function must -# therefore be the same as those used in compinit. - -emulate -L zsh -setopt extendedglob - -[[ -n $commands[getent] ]] || getent() { - if [[ $1 = hosts ]]; then - sed 's/#.*//' /etc/$1 | grep -w $2 - elif [[ $2 = <-> ]]; then - grep ":$2:[^:]*$" /etc/$1 - else - grep "^$2:" /etc/$1 - fi -} - -# The positional parameters are the directories to check, else fpath. -if (( $# )); then - local _compdir='' -elif (( $#fpath == 0 )); then - print 'compaudit: No directories in $fpath, cannot continue' 1>&2 - return 1 -else - set -- $fpath -fi - -# _i_check is defined by compinit; used here as a test for whether this -# function is running standalone or was called by compinit. If called -# by compinit, we use parameters that are defined in compinit's scope, -# otherwise we make them local here. -(( $+_i_check )) || { - local _i_q _i_line _i_file _i_fail=verbose - local -a _i_files _i_addfiles _i_wdirs _i_wfiles - local -a -U +h fpath -} - -fpath=( $* ) - -# _compdir may be defined by the user; see the compinit documentation. -# If it isn't defined, we want it to point somewhere sensible, but the -# user is allowed to set it to empty to bypass the check below. -(( $+_compdir )) || { - local _compdir=${fpath[(r)*/$ZSH_VERSION/*]} - [[ -z $_compdir ]] && _compdir=$fpath[1] - ### [[ -d $_compdir/../Base ]] && _compdir=${_compdir:h} -} - -_i_wdirs=() -_i_wfiles=() - -_i_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N) ) -if [[ -n $_compdir ]]; then - if [[ $#_i_files -lt 20 || $_compdir = */Base || -d $_compdir/Base ]]; then - # Too few files: we need some more directories, or we need to check - # that all directories (not just Base) are present. - _i_addfiles=() - if [[ -d $_compdir/Base/Core ]]; then - # Add all the Completion subdirectories (CVS-layout) - _i_addfiles=(${_compdir}/*/*(/^M)) - elif [[ -d $_compdir/Base ]]; then - # Likewise (installation-layout) - _i_addfiles=(${_compdir}/*(/^M)) - fi - for _i_line in {1..$#_i_addfiles}; do - (( $_i_line )) || break - _i_file=${_i_addfiles[$_i_line]} - [[ -d $_i_file && -z ${fpath[(r)$_i_file]} ]] || - _i_addfiles[$_i_line]= - done - fpath=($fpath $_i_addfiles) - _i_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N) ) - fi -fi - -[[ $_i_fail == use ]] && return 0 - -# We will always allow files to be owned by root and the owner of the -# present process. -local _i_owners="u0u${EUID}" - -# Places we will look for a link to the executable -local -a _i_exes -_i_exes=( - /proc/$$/exe - /proc/$$/object/a.out - ) -local _i_exe - -# If we can find out who owns the executable, we will allow files to -# be owned by that user, too. The argument is that if you don't trust -# the owner of the executable, it's way too late to worry about it now... -for _i_exe in $_i_exes; do - if [[ -e $_i_exe ]] ;then - if zmodload -F zsh/stat b:zstat 2>/dev/null; then - local -A _i_stathash - if zstat -H _i_stathash $_i_exe && - [[ $_i_stathash[uid] -ne 0 ]]; then - _i_owners+="u${_i_stathash[uid]}" - fi - fi - break - fi -done - -# We search for: -# - world/group-writable directories in fpath not owned by $_i_owners -# - parent-directories of directories in fpath that are world/group-writable -# and not owned by $_i_owners (that would allow someone to put a -# digest file for one of the directories into the parent directory) -# - digest files for one of the directories in fpath not owned by $_i_owners -# - and for files in directories from fpath not owned by $_i_owners -# (including zwc files) - -_i_wdirs=( ${^fpath}(N-f:g+w:,-f:o+w:,-^${_i_owners}) - ${^fpath:h}(N-f:g+w:,-f:o+w:,-^${_i_owners}) ) - -# RedHat Linux "per-user groups" check. This is tricky, because it's very -# difficult to tell whether the sysadmin has put someone else into your -# "private" group (e.g., via the default group field in /etc/passwd, or -# by NFS group sharing with an untrustworthy machine). So we must assume -# that this has not happened, and pick the best group. - -if (( $#_i_wdirs )); then - local GROUP GROUPMEM _i_pw _i_gid - if ((UID == EUID )); then - getent group $LOGNAME | IFS=: read GROUP _i_pw _i_gid GROUPMEM - else - getent group $EGID | IFS=: read GROUP _i_pw _i_gid GROUPMEM - fi - - if [[ $GROUP == $LOGNAME && ( -z $GROUPMEM || $GROUPMEM == $LOGNAME ) ]] - then - _i_wdirs=( ${^_i_wdirs}(N-f:g+w:^g:${GROUP}:,-f:o+w:,-^${_i_owners}) ) - fi -fi - -if [[ -f /etc/debian_version ]] -then - local _i_ulwdirs - _i_ulwdirs=( ${(M)_i_wdirs:#/usr/local/*} ) - _i_wdirs=( ${_i_wdirs:#/usr/local/*} ${^_i_ulwdirs}(Nf:g+ws:^g:staff:,f:o+w:,^u0) ) -fi - -_i_wdirs=( $_i_wdirs ${^fpath}.zwc^([^_]*|*~)(N-^${_i_owners}) ) -_i_wfiles=( ${^fpath}/^([^_]*|*~)(N-^${_i_owners}) ) - -case "${#_i_wdirs}:${#_i_wfiles}" in -(0:0) _i_q= ;; -(0:*) _i_q=files ;; -(*:0) _i_q=directories ;; -(*:*) _i_q='directories and files' ;; -esac - -if [[ -n "$_i_q" ]]; then - [[ $_i_fail == verbose ]] && { - print There are insecure ${_i_q}: 1>&2 - print -l - $_i_wdirs $_i_wfiles - } - return 1 -fi -return 0 - -} # Define and then call - -compaudit "$@" diff --git a/zsh_arm64/system/usr/share/zsh/functions/compdump b/zsh_arm64/system/usr/share/zsh/functions/compdump deleted file mode 100644 index e0dc8b8..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/compdump +++ /dev/null @@ -1,139 +0,0 @@ -# This is a function to dump the definitions for new-style -# completion defined by 'compinit' in the same directory. The output -# should be directed into the "compinit.dump" in the same directory as -# compinit. If you rename init, just stick .dump onto the end of whatever -# you have called it and put it in the same directory. This is handled -# automatically if you invoke compinit with the option -d. -# -# You will need to update the dump every time you add a new completion. -# To do this, simply remove the .dump file, start a new shell, and -# create the .dump file as before. Again, compinit -d handles this -# automatically. - -# Print the number of files used for completion. This is used in compinit -# to see if auto-dump should re-dump the dump-file. - -emulate -L zsh -setopt extendedglob noshglob - -typeset _d_file _d_f _d_bks _d_line _d_als _d_files _d_name _d_tmp - -_d_file=${_comp_dumpfile-${0:h}/compinit.dump}.$HOST.$$ -[[ $_d_file = //* ]] && _d_file=${_d_file[2,-1]} - -[[ -w ${_d_file:h} ]] || return 1 - -_d_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N) ) - -if [[ -n "$_comp_secure" ]]; then - _d_wdirs=( ${^fpath}(Nf:g+w:,f:o+w:,^u0u${EUID}) ) - _d_wfiles=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N^u0u${EUID}) ) - - (( $#_d_wfiles )) && _d_files=( "${(@)_d_files:#(${(j:|:)_d_wfiles})}" ) - (( $#_d_wdirs )) && _d_files=( "${(@)_d_files:#(${(j:|:)_d_wdirs})/*}" ) -fi - -print "#files: $#_d_files\tversion: $ZSH_VERSION" > $_d_file - -# Dump the arrays _comps, _services and _patcomps. The quoting -# hieroglyphics ensure that a single quote inside a variable is itself -# correctly quoted. - -print "\n_comps=(" >> $_d_file -for _d_f in ${(ok)_comps}; do - print -r - "${(qq)_d_f}" "${(qq)_comps[$_d_f]}" -done >> $_d_file -print ")" >> $_d_file - -print "\n_services=(" >> $_d_file -for _d_f in ${(ok)_services}; do - print -r - "${(qq)_d_f}" "${(qq)_services[$_d_f]}" -done >> $_d_file -print ")" >> $_d_file - -print "\n_patcomps=(" >> $_d_file -for _d_f in ${(ok)_patcomps}; do - print -r - "${(qq)_d_f}" "${(qq)_patcomps[$_d_f]}" -done >> $_d_file -print ")" >> $_d_file - -_d_tmp="_postpatcomps" -print "\n_postpatcomps=(" >> $_d_file -for _d_f in ${(ok)_postpatcomps}; do - print -r - "${(qq)_d_f}" "${(qq)_postpatcomps[$_d_f]}" -done >> $_d_file -print ")" >> $_d_file - -print "\n_compautos=(" >> $_d_file -for _d_f in "${(ok@)_compautos}"; do - print -r - "${(qq)_d_f}" "${(qq)_compautos[$_d_f]}" -done >> $_d_file -print ")" >> $_d_file - -print >> $_d_file - -# Now dump the key bindings. We dump all bindings for zle widgets -# whose names start with a underscore. -# We need both the zle -C's and the bindkey's to recreate. -# We can ignore any zle -C which rebinds a standard widget (second -# argument to zle does not begin with a `_'). - -_d_bks=() -typeset _d_complist= -zle -lL | - while read -rA _d_line; do - if [[ ${_d_line[3]} = _* && ${_d_line[5]} = _* ]]; then - if [[ -z "$_d_complist" && ${_d_line[4]} = .menu-select ]]; then - print 'zmodload -i zsh/complist' - _d_complist=yes - fi - print -r - ${_d_line} - _d_bks+=(${_d_line[3]}) - fi - done >> $_d_file -bindkey | - while read -rA _d_line; do - if [[ ${_d_line[2]} = (${(j.|.)~_d_bks}) ]]; then - print -r "bindkey '${_d_line[1][2,-2]}' ${_d_line[2]}" - fi - done >> $_d_file - -print >> $_d_file - - -# Autoloads: look for all defined functions beginning with `_' (that also -# exists in fpath: see workers/38547). - -_d_als=($^fpath/(${(o~j.|.)$(typeset +fm '_*')})(N:t)) - -# print them out: about five to a line looks neat - -integer _i=5 -print -n autoload -Uz >> $_d_file -while (( $#_d_als )); do - if (( ! $+_compautos[$_d_als[1]] )); then - print -n " $_d_als[1]" - if (( ! --_i && $#_d_als > 1 )); then - _i=5 - print -n ' \\\n ' - fi - fi - shift _d_als -done >> $_d_file - -print >> $_d_file - -local _c -for _c in "${(ok@)_compautos}"; do - print "autoload -Uz $_compautos[$_c] $_c" >> $_d_file -done - -print >> $_d_file - -print "typeset -gUa _comp_assocs" >> $_d_file -print "_comp_assocs=( ${(qq)_comp_assocs} )" >> $_d_file - -mv -f $_d_file ${_d_file%.$HOST.$$} - -unfunction compdump -autoload -Uz compdump diff --git a/zsh_arm64/system/usr/share/zsh/functions/compinit b/zsh_arm64/system/usr/share/zsh/functions/compinit deleted file mode 100644 index f0f8421..0000000 --- a/zsh_arm64/system/usr/share/zsh/functions/compinit +++ /dev/null @@ -1,549 +0,0 @@ -# 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 ' -# If the first line looks like this, the file is autoloaded as a -# function and that function will be called to generate the matches -# when completing for one of the commands whose are given. -# The names may also be interspersed with `-T ' options -# specifying for which set of functions this should be added. -# -# `#compdef -[pP] ' -# This defines a function that should be called to generate matches -# for commands whose name matches . Note that only one pattern -# may be given. -# -# `#compdef -k