fix: cleanup style, naming, and completion

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
Vladislav Doster 2023-04-10 06:43:28 -05:00
parent a86590762a
commit 6c82d6788d
5 changed files with 1689 additions and 1691 deletions

8
_zinit
View file

@ -21,11 +21,11 @@ __zinit_commands(){
'cdreplay:Replay compdef list'
'cenable:Enable completions'
'changes:View plugins git log'
'clist:List completions in use'
'clist:List status of all installed completions'
'compile:Compile plugin (or all plugins if --all passed)'
'compiled:List of compiled plugins'
'compinit:Refresh installed completions'
'completions:List completions in use'
'completions:List status of all installed completions'
'create:Create plugin (also together with Github repository)'
'creinstall:Install completions for plugin'
'csearch:Search for available completions from any plugin'
@ -41,17 +41,17 @@ __zinit_commands(){
'env-whitelist:Specify names (also patterns) of parameters to be left unchanged during an unload'
'glance:Look at plugins source'
'help:Usage information'
'list-plugins:List status of all installed plugins'
'list-snippets:List status of all installed snippets'
'load:Load plugin'
'man:Display Zinit'\''s manpage'
'module:Manage binary Zsh module shipped with Zinit'
'plugins:List status of all installed plugins'
'recall:Fetch saved ice modifiers and construct '
'recently:Show plugins that changed recently'
'report:Show plugins report'
'run:Run a command inside plugins folder'
'self-update:Fetch the newest version of Zinit from GitHub using `git`(1) and recompile'
'snippet:Source a local or remote file'
'snippets:List status of all installed snippets'
'srv:Control a service, command'
'status:Git status for plugin'
'stress:Test plugin for compatibility with set of options'

View file

@ -41,7 +41,8 @@ Documentation automatically generated with `zshelldoc'
.zinit-help
.zinit-list-bindkeys
.zinit-list-compdef-replay
.zinit-ls
.zinit-list-plugins
.zinit-list-snippets
.zinit-module
.zinit-pager
.zinit-prepare-readlink
@ -56,7 +57,6 @@ Documentation automatically generated with `zshelldoc'
.zinit-show-all-reports
.zinit-show-completions
.zinit-show-debug-report
.zinit-show-registered-plugins
.zinit-show-report
.zinit-show-times
.zinit-show-zstatus
@ -831,7 +831,26 @@ Called by:
zinit.zsh/zinit
==== .zinit-ls
==== .zinit-list-plugins
____
Lists loaded plugins (subcommands list, lodaded)
____
Has 21 line(s). Calls functions:
.zinit-list-plugins
`-- zinit.zsh/+zinit-message
Uses feature(s): _setopt_
Called by:
zinit.zsh/zinit
==== .zinit-list-snippets
Has 20 line(s). Doesn't call other functions.
@ -1149,25 +1168,6 @@ Has 1 line(s). Calls functions:
|-- .zinit-format-parameter
`-- zinit.zsh/.zinit-any-to-user-plugin
Called by:
zinit.zsh/zinit
==== .zinit-show-registered-plugins
____
Lists loaded plugins (subcommands list, lodaded)
____
Has 21 line(s). Calls functions:
.zinit-show-registered-plugins
`-- zinit.zsh/+zinit-message
Uses feature(s): _setopt_
Called by:
zinit.zsh/zinit

View file

@ -185,7 +185,8 @@ Has 244 line(s). Calls functions:
|   |-- zinit-autoload.zsh/.zinit-help
|   |-- zinit-autoload.zsh/.zinit-list-bindkeys
|   |-- zinit-autoload.zsh/.zinit-list-compdef-replay
|   |-- zinit-autoload.zsh/.zinit-ls
|   |-- zinit-autoload.zsh/.zinit-list-plugins
|   |-- zinit-autoload.zsh/.zinit-list-snippets
|   |-- zinit-autoload.zsh/.zinit-module
|   |-- zinit-autoload.zsh/.zinit-recently
|   |-- zinit-autoload.zsh/.zinit-search-completions
@ -193,7 +194,6 @@ Has 244 line(s). Calls functions:
|   |-- zinit-autoload.zsh/.zinit-show-all-reports
|   |-- zinit-autoload.zsh/.zinit-show-completions
|   |-- zinit-autoload.zsh/.zinit-show-debug-report
|   |-- zinit-autoload.zsh/.zinit-show-registered-plugins
|   |-- zinit-autoload.zsh/.zinit-show-report
|   |-- zinit-autoload.zsh/.zinit-show-times
|   |-- zinit-autoload.zsh/.zinit-show-zstatus
@ -256,8 +256,8 @@ Called by:
zinit-autoload.zsh/.zinit-confirm
zinit-autoload.zsh/.zinit-delete
zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/.zinit-list-plugins
zinit-autoload.zsh/.zinit-self-update
zinit-autoload.zsh/.zinit-show-registered-plugins
zinit-autoload.zsh/.zinit-show-zstatus
zinit-autoload.zsh/.zinit-uninstall-completions
zinit-autoload.zsh/.zinit-update-all-parallel
@ -1578,7 +1578,7 @@ ____
____
Has 568 line(s). Calls functions:
Has 564 line(s). Calls functions:
zinit
|-- +zinit-message
@ -1669,7 +1669,8 @@ Has 568 line(s). Calls functions:
|-- zinit-autoload.zsh/.zinit-help
|-- zinit-autoload.zsh/.zinit-list-bindkeys
|-- zinit-autoload.zsh/.zinit-list-compdef-replay
|-- zinit-autoload.zsh/.zinit-ls
|-- zinit-autoload.zsh/.zinit-list-plugins
|-- zinit-autoload.zsh/.zinit-list-snippets
|-- zinit-autoload.zsh/.zinit-module
|-- zinit-autoload.zsh/.zinit-recently
|-- zinit-autoload.zsh/.zinit-search-completions
@ -1677,7 +1678,6 @@ Has 568 line(s). Calls functions:
|-- zinit-autoload.zsh/.zinit-show-all-reports
|-- zinit-autoload.zsh/.zinit-show-completions
|-- zinit-autoload.zsh/.zinit-show-debug-report
|-- zinit-autoload.zsh/.zinit-show-registered-plugins
|-- zinit-autoload.zsh/.zinit-show-report
|-- zinit-autoload.zsh/.zinit-show-times
|-- zinit-autoload.zsh/.zinit-show-zstatus
@ -1831,7 +1831,8 @@ Has 1 line(s). Calls functions:
|-- zinit-autoload.zsh/.zinit-help
|-- zinit-autoload.zsh/.zinit-list-bindkeys
|-- zinit-autoload.zsh/.zinit-list-compdef-replay
|-- zinit-autoload.zsh/.zinit-ls
|-- zinit-autoload.zsh/.zinit-list-plugins
|-- zinit-autoload.zsh/.zinit-list-snippets
|-- zinit-autoload.zsh/.zinit-module
|-- zinit-autoload.zsh/.zinit-recently
|-- zinit-autoload.zsh/.zinit-search-completions
@ -1839,7 +1840,6 @@ Has 1 line(s). Calls functions:
|-- zinit-autoload.zsh/.zinit-show-all-reports
|-- zinit-autoload.zsh/.zinit-show-completions
|-- zinit-autoload.zsh/.zinit-show-debug-report
|-- zinit-autoload.zsh/.zinit-show-registered-plugins
|-- zinit-autoload.zsh/.zinit-show-report
|-- zinit-autoload.zsh/.zinit-show-times
|-- zinit-autoload.zsh/.zinit-show-zstatus
@ -1891,7 +1891,7 @@ ____
____
Has 134 line(s). Doesn't call other functions.
Has 120 line(s). Doesn't call other functions.
Called by:

File diff suppressed because it is too large Load diff

View file

@ -121,10 +121,11 @@ fpath|\
glance|\
help|\
ice|\
light|list-plugins|list-snippets|load|\
light|load|\
man|module|\
plugins|\
recall|recently|report|run|\
self-update|snippet|srv|status|stress|\
self-update|snippet|snippets|srv|status|stress|\
times|\
uncompile|unload|update|\
version|\
@ -2945,13 +2946,10 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
.zinit-list-bindkeys
;;
(update)
if (( ${+ICE[if]} )) {
eval "${ICE[if]}" || return 1;
}
(( ${+ICE[if]} )) && { eval "${ICE[if]}" } || return 1
for REPLY ( ${(s.;.)ICE[has]} ) {
(( ${+commands[$REPLY]} )) || return 1
}
shift
.zinit-parse-opts update "$@"
builtin set -- "${reply[@]}"
@ -2976,22 +2974,21 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
(report)
if [[ $2 = --all || ( -z $2 && -z $3 ) ]]; then
[[ -z $2 ]] && { builtin print -r -- "Assuming --all is passed"; sleep 4; }
.zinit-show-all-reports
.zinit-show-all-reports
else
.zinit-show-report "${2%%(///|//|/)}" "${3%%(///|//|/)}"; ___retval=$?
fi
;;
(list-plugins)
# Show list of loaded plugins.
.zinit-show-registered-plugins "$2"
;;
(clist|completions)
# Show installed, enabled or disabled, completions.
# Detect stray and improper ones.
(plugins)
.zinit-list-plugins "$2"
;;
(snippets)
.zinit-list-snippets "$2"
;;
(completions) # Show installed, enabled or disabled, completions and detect stray and improper ones
.zinit-show-completions "$2"
;;
(cclear)
# Delete stray and improper completions.
(cclear) # Delete stray and improper completions.
.zinit-clear-completions
;;
(cdisable)
@ -3032,8 +3029,7 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
;;
(creinstall)
(( ${+functions[.zinit-install-completions]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh" || return 1
# Installs completions for plugin. Enables them all. It's a
# reinstallation, thus every obstacle gets overwritten or removed.
# Installs completions for plugin. Enables them all. It is a reinstallation, thus every obstacle gets overwritten or removed.
[[ $2 = -[qQ] ]] && { 5=$2; shift; }
.zinit-install-completions "${2%%(///|//|/)}" "${3%%(///|//|/)}" 1 "${(M)4:#-[qQ]}"; ___retval=$?
[[ -z ${(M)4:#-[qQ]} ]] && +zinit-message "Initializing completion ({func}compinit{rst}){…}"
@ -3106,10 +3102,6 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
(version)
zi::version
;;
(list-snippets)
shift
.zinit-ls "$@"
;;
(srv)
() { setopt localoptions extendedglob warncreateglobal
[[ ! -e ${ZINIT[SERVICES_DIR]}/"$2".fifo ]] && { builtin print "No such service: $2"; } ||
@ -3125,16 +3117,16 @@ You can try to prepend {apo}${___q}{lhi}@{apo}'{error} to the ID if the last ice
.zinit-module "${@[2-correct,-1]}"; ___retval=$?
;;
(*)
if [[ -z $1 ]] {
+zinit-message -n "{b}{u-warn}ERROR{b-warn}:{rst} Missing a {cmd}subcommand "
+zinit-prehelp-usage-message rst
} else {
+zinit-message -n "{b}{u-warn}ERROR{b-warn}:{rst} Unknown subcommand{ehi}:{rst}" \
"{apo}\`{error}$1{apo}\`{rst} "
+zinit-prehelp-usage-message rst
}
___retval=1
;;
if [[ -z $1 ]] {
+zinit-message -n "{b}{u-warn}ERROR{b-warn}:{rst} Missing a {cmd}subcommand "
+zinit-prehelp-usage-message rst
} else {
+zinit-message -n "{b}{u-warn}ERROR{b-warn}:{rst} Unknown subcommand{ehi}:{rst}" \
"{apo}\`{error}$1{apo}\`{rst} "
+zinit-prehelp-usage-message rst
}
___retval=1
;;
esac
;;
esac