Compare commits
No commits in common. "bc3e26df052013a3cf22cdc0d1ee8693686afe9f" and "372465e71ca072cff5049a1edbfcbd649c8fb404" have entirely different histories.
bc3e26df05
...
372465e71c
6 changed files with 142 additions and 1749 deletions
|
@ -14,5 +14,4 @@ bin/lock
|
|||
.config/rofi
|
||||
.config/swayidle
|
||||
.config/swaylock
|
||||
.config/kanshi
|
||||
{{- end }}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#compdef chezmoi
|
||||
compdef _chezmoi chezmoi
|
||||
|
||||
# zsh completion for chezmoi -*- shell-script -*-
|
||||
|
||||
|
@ -18,9 +17,8 @@ _chezmoi()
|
|||
local shellCompDirectiveNoFileComp=4
|
||||
local shellCompDirectiveFilterFileExt=8
|
||||
local shellCompDirectiveFilterDirs=16
|
||||
local shellCompDirectiveKeepOrder=32
|
||||
|
||||
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
|
||||
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace
|
||||
local -a completions
|
||||
|
||||
__chezmoi_debug "\n========= starting completion logic =========="
|
||||
|
@ -138,11 +136,6 @@ _chezmoi()
|
|||
noSpace="-S ''"
|
||||
fi
|
||||
|
||||
if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
|
||||
__chezmoi_debug "Activating keep order."
|
||||
keepOrder="-V"
|
||||
fi
|
||||
|
||||
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
||||
# File extension filtering
|
||||
local filteringCmd
|
||||
|
@ -178,7 +171,7 @@ _chezmoi()
|
|||
return $result
|
||||
else
|
||||
__chezmoi_debug "Calling _describe"
|
||||
if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then
|
||||
if eval _describe "completions" completions $flagPrefix $noSpace; then
|
||||
__chezmoi_debug "_describe found some completions"
|
||||
|
||||
# Return the success of having called _describe
|
||||
|
|
|
@ -43,7 +43,7 @@ _pdm() {
|
|||
|
||||
_arguments -s -C -A '-*' \
|
||||
$arguments \
|
||||
{-c,--config}'[Specify another config file path\[env var: PDM_CONFIG_FILE\]]' \
|
||||
{-c,--config}'[Specify another config file path(env var: PDM_CONFIG_FILE)]' \
|
||||
{-V,--version}'[Show the version and exit]' \
|
||||
{-I,--ignore-python}'[Ignore the Python path saved in .pdm-python]' \
|
||||
'--pep582:Print the command line to be eval by the shell:shell:(zsh bash fish tcsh csh)' \
|
||||
|
@ -70,17 +70,15 @@ _pdm() {
|
|||
'--save-exact[Save exact version specifiers]'
|
||||
'--save-minimum[Save minimum version specifiers]'
|
||||
'--update-reuse[Reuse pinned versions already present in lock file if possible]'
|
||||
'--update-reuse-installed[Reuse installed packages if possible]'
|
||||
'--update-eager[Try to update the packages and their dependencies recursively]'
|
||||
'--update-all[Update all dependencies and sub-dependencies]'
|
||||
'--no-editable[Install non-editable versions for all packages]'
|
||||
"--no-self[Don't install the project itself]"
|
||||
"--frozen-lockfile[Don't try to create or update the lockfile. \[env var: PDM_FROZEN_LOCKFILE\]]"
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
|
||||
{-u,--unconstrained}'[Ignore the version constraint of packages]'
|
||||
{--pre,--prerelease}'[Allow prereleases to be pinned]'
|
||||
"--stable[Only allow stable versions to be pinned]"
|
||||
{-e+,--editable+}'[Specify editable packages]:packages'
|
||||
{-x,--fail-fast}'[Abort on first installation error]'
|
||||
"--no-isolation[do not isolate the build in a clean environment]"
|
||||
|
@ -149,11 +147,8 @@ _pdm() {
|
|||
arguments+=(
|
||||
{-g,--global}'[Use the global project, supply the project root with `-p` option]'
|
||||
{-f+,--format+}"[Specify the export file format]:format:(pipfile poetry flit requirements setuppy)"
|
||||
"--no-hashes[Don't include artifact hashes]"
|
||||
"--no-markers[Don't include platform markers]"
|
||||
"--without-hashes[Don't include artifact hashes]"
|
||||
"--expandvars[Expand environment variables in requirements]"
|
||||
"--self[Include the project itself]"
|
||||
"--editable-self[Include the project itself as an editable dependency]"
|
||||
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
|
||||
{-o+,--output+}"[Write output to the given file, or print to stdout if not given]:output file:_files"
|
||||
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups'
|
||||
|
@ -184,7 +179,7 @@ _pdm() {
|
|||
'--env[Show PEP 508 environment markers]'
|
||||
'--packages[Show the packages root]'
|
||||
'--json[Dump the information in JSON]'
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
)
|
||||
;;
|
||||
init)
|
||||
|
@ -193,8 +188,8 @@ _pdm() {
|
|||
{-n,--non-interactive}"[Don't ask questions but use default values]"
|
||||
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
|
||||
{-r,--overwrite}'[Overwrite existing files]'
|
||||
'--backend[Specify the build backend, which implies --dist]:backend:(pdm-backend setuptools hatchling flit)'
|
||||
{--dist,--lib}'[Create a package for distribution]'
|
||||
'--backend[Specify the build backend]:backend:(pdm-backend setuptools hatchling flit)'
|
||||
'--lib[Create a library project]'
|
||||
'--python[Specify the Python version/path to use]:python:'
|
||||
'--copier[Use Copier to generate project]'
|
||||
'--cookiecutter[Use Cookiecutter to generate project]'
|
||||
|
@ -209,7 +204,7 @@ _pdm() {
|
|||
{-L,--lockfile}'[Specify another lockfile path, or use `PDM_LOCKFILE` env variable. Default: pdm.lock]:lockfile:_files'
|
||||
{--prod,--production}"[Unselect dev dependencies]"
|
||||
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
|
||||
"--frozen-lockfile[Don't try to create or update the lockfile. \[env var: PDM_FROZEN_LOCKFILE\]]"
|
||||
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
|
||||
"--no-default[Don\'t include dependencies from the default group]"
|
||||
'--no-editable[Install non-editable versions for all packages]'
|
||||
"--no-self[Don't install the project itself]"
|
||||
|
@ -218,7 +213,7 @@ _pdm() {
|
|||
"--dry-run[Show the difference only without modifying the lock file content]"
|
||||
"--check[Check if the lock file is up to date and fail otherwise]"
|
||||
"--plugins[Install the plugins specified in pyproject.toml]"
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
)
|
||||
;;
|
||||
list)
|
||||
|
@ -235,7 +230,7 @@ _pdm() {
|
|||
"--include[Dependency groups to include in the output. By default all are included]:include:"
|
||||
"--exclude[Dependency groups to exclude from the output]:exclude:"
|
||||
"--resolve[Resolve all requirements to output licenses (instead of just showing those currently installed)]"
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
'*:patterns:'
|
||||
)
|
||||
;;
|
||||
|
@ -250,13 +245,11 @@ _pdm() {
|
|||
{-G+,--group+}'[Select group of optional-dependencies or dev-dependencies(with -d). Can be supplied multiple times, use ":all" to include all groups under the same species]:group:_pdm_groups'
|
||||
{-d,--dev}"[Select dev dependencies]"
|
||||
{--prod,--production}"[Unselect dev dependencies]"
|
||||
'--update-reuse[Reuse pinned versions already present in lock file if possible]'
|
||||
'--update-reuse-installed[Reuse installed packages if possible]'
|
||||
"--static-urls[(DEPRECATED) Store static file URLs in the lockfile]"
|
||||
"--no-static-urls[(DEPRECATED) Do not store static file URLs in the lockfile]"
|
||||
"--no-default[Don\'t include dependencies from the default group]"
|
||||
"--no-cross-platform[(DEPRECATED) Only lock packages for the current platform]"
|
||||
{-S,--strategy}'[Specify lock strategy(cross_platform,static_urls,direct_minimal_versions). Add no_ prefix to disable. Support given multiple times or split by comma.]:strategy:'
|
||||
{-S,--strategy}'Specify lock strategy(cross_platform,static_urls,direct_minimal_versions). Add no_ prefix to disable. Support given multiple times or split by comma.:strategy:'
|
||||
)
|
||||
;;
|
||||
self)
|
||||
|
@ -310,9 +303,9 @@ _pdm() {
|
|||
;;
|
||||
publish)
|
||||
arguments+=(
|
||||
{-r,--repository}'[The repository name or url to publish the package to }\[env var: PDM_PUBLISH_REPO\]]:repository:'
|
||||
{-u,--username}'[The username to access the repository \[env var: PDM_PUBLISH_USERNAME\]]:username:'
|
||||
{-P,--password}'[The password to access the repository \[env var: PDM_PUBLISH_PASSWORD\]]:password:'
|
||||
{-r,--repository}'[The repository name or url to publish the package to }[env var: PDM_PUBLISH_REPO]]:repository:'
|
||||
{-u,--username}'[The username to access the repository [env var: PDM_PUBLISH_USERNAME]]:username:'
|
||||
{-P,--password}'[The password to access the repository [env var: PDM_PUBLISH_PASSWORD]]:password:'
|
||||
{-S,--sign}'[Upload the package with PGP signature]'
|
||||
{-i,--identity}'[GPG identity used to sign files.]:gpg identity:'
|
||||
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
|
||||
|
@ -320,7 +313,6 @@ _pdm() {
|
|||
"--no-verify-ssl[Disable SSL verification]"
|
||||
"--ca-certs[The path to a PEM-encoded Certificate Authority bundle to use for publish server validation]:cacerts:_files"
|
||||
"--no-build[Don't build the package before publishing]"
|
||||
"--skip-existing[Skip uploading files that already exist. This may not work with some repository implementations.]"
|
||||
)
|
||||
;;
|
||||
remove)
|
||||
|
@ -333,11 +325,11 @@ _pdm() {
|
|||
"--no-sync[Only write pyproject.toml and do not uninstall packages]"
|
||||
'--no-editable[Install non-editable versions for all packages]'
|
||||
"--no-self[Don't install the project itself]"
|
||||
"--frozen-lockfile[Don't try to create or update the lockfile. \[env var: PDM_FROZEN_LOCKFILE\]]"
|
||||
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
|
||||
{-x,--fail-fast}'[Abort on first installation error]'
|
||||
"--no-isolation[do not isolate the build in a clean environment]"
|
||||
"--dry-run[Show the difference only without modifying the lockfile content]"
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
"*:packages:_pdm_packages"
|
||||
)
|
||||
;;
|
||||
|
@ -348,7 +340,7 @@ _pdm() {
|
|||
'--json[Output all scripts infos in JSON]' \
|
||||
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]' \
|
||||
{-s,--site-packages}'[Load site-packages from the selected interpreter]' \
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:' \
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:' \
|
||||
'(-)1:command:->command' \
|
||||
'*:arguments: _normal ' && return 0
|
||||
if [[ $state == command ]]; then
|
||||
|
@ -372,7 +364,7 @@ _pdm() {
|
|||
'--license[Show license]'
|
||||
'--platform[Show platform]'
|
||||
'--keywords[Show keywords]'
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
'1:package:'
|
||||
)
|
||||
;;
|
||||
|
@ -393,7 +385,7 @@ _pdm() {
|
|||
'--no-editable[Install non-editable versions for all packages]'
|
||||
"--no-self[Don't install the project itself]"
|
||||
"--no-isolation[do not isolate the build in a clean environment]"
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
)
|
||||
;;
|
||||
update)
|
||||
|
@ -408,15 +400,13 @@ _pdm() {
|
|||
'--update-reuse[Reuse pinned versions already present in lock file if possible]'
|
||||
'--update-eager[Try to update the packages and their dependencies recursively]'
|
||||
'--update-all[Update all dependencies and sub-dependencies]'
|
||||
'--update-reuse-installed[Reuse installed packages if possible]'
|
||||
'--no-editable[Install non-editable versions for all packages]'
|
||||
"--no-self[Don't install the project itself]"
|
||||
"--no-sync[Only update lock file but do not sync packages]"
|
||||
"--frozen-lockfile[Don't try to create or update the lockfile. \[env var: PDM_FROZEN_LOCKFILE\]]"
|
||||
"--no-lock[Don't try to create or update the lockfile. [env var: PDM_NO_LOCK]]"
|
||||
{-k,--skip}'[Skip some tasks and/or hooks by their comma-separated names]'
|
||||
{-u,--unconstrained}'[Ignore the version constraint of packages]'
|
||||
{--pre,--prerelease}'[Allow prereleases to be pinned]'
|
||||
"--stable[Only allow stable versions to be pinned]"
|
||||
{-d,--dev}'[Select dev dependencies]'
|
||||
{--prod,--production}"[Unselect dev dependencies]"
|
||||
"--no-default[Don\'t include dependencies from the default group]"
|
||||
|
@ -425,7 +415,7 @@ _pdm() {
|
|||
"--outdated[Show the difference only without modifying the lockfile content]"
|
||||
{-x,--fail-fast}'[Abort on first installation error]'
|
||||
"--no-isolation[do not isolate the build in a clean environment]"
|
||||
'--venv[Run the command in the virtual environment with the given key. \[env var: PDM_IN_VENV\]]:venv:'
|
||||
'--venv[Run the command in the virtual environment with the given key. (env var: PDM_IN_VENV)]:venv:'
|
||||
"*:packages:_pdm_packages"
|
||||
)
|
||||
;;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,5 @@
|
|||
#compdef _rclone rclone
|
||||
#compdef rclone
|
||||
compdef _rclone rclone
|
||||
|
||||
# zsh completion for rclone -*- shell-script -*-
|
||||
|
||||
|
@ -17,8 +18,9 @@ _rclone()
|
|||
local shellCompDirectiveNoFileComp=4
|
||||
local shellCompDirectiveFilterFileExt=8
|
||||
local shellCompDirectiveFilterDirs=16
|
||||
local shellCompDirectiveKeepOrder=32
|
||||
|
||||
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace
|
||||
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
|
||||
local -a completions
|
||||
|
||||
__rclone_debug "\n========= starting completion logic =========="
|
||||
|
@ -86,7 +88,24 @@ _rclone()
|
|||
return
|
||||
fi
|
||||
|
||||
local activeHelpMarker="_activeHelp_ "
|
||||
local endIndex=${#activeHelpMarker}
|
||||
local startIndex=$((${#activeHelpMarker}+1))
|
||||
local hasActiveHelp=0
|
||||
while IFS='\n' read -r comp; do
|
||||
# Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
|
||||
if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
|
||||
__rclone_debug "ActiveHelp found: $comp"
|
||||
comp="${comp[$startIndex,-1]}"
|
||||
if [ -n "$comp" ]; then
|
||||
compadd -x "${comp}"
|
||||
__rclone_debug "ActiveHelp will need delimiter"
|
||||
hasActiveHelp=1
|
||||
fi
|
||||
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -n "$comp" ]; then
|
||||
# If requested, completions are returned with a description.
|
||||
# The description is preceded by a TAB character.
|
||||
|
@ -94,7 +113,7 @@ _rclone()
|
|||
# We first need to escape any : as part of the completion itself.
|
||||
comp=${comp//:/\\:}
|
||||
|
||||
local tab=$(printf '\t')
|
||||
local tab="$(printf '\t')"
|
||||
comp=${comp//$tab/:}
|
||||
|
||||
__rclone_debug "Adding completion: ${comp}"
|
||||
|
@ -103,11 +122,27 @@ _rclone()
|
|||
fi
|
||||
done < <(printf "%s\n" "${out[@]}")
|
||||
|
||||
# Add a delimiter after the activeHelp statements, but only if:
|
||||
# - there are completions following the activeHelp statements, or
|
||||
# - file completion will be performed (so there will be choices after the activeHelp)
|
||||
if [ $hasActiveHelp -eq 1 ]; then
|
||||
if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
|
||||
__rclone_debug "Adding activeHelp delimiter"
|
||||
compadd -x "--"
|
||||
hasActiveHelp=0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
|
||||
__rclone_debug "Activating nospace."
|
||||
noSpace="-S ''"
|
||||
fi
|
||||
|
||||
if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
|
||||
__rclone_debug "Activating keep order."
|
||||
keepOrder="-V"
|
||||
fi
|
||||
|
||||
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
||||
# File extension filtering
|
||||
local filteringCmd
|
||||
|
@ -125,7 +160,7 @@ _rclone()
|
|||
_arguments '*:filename:'"$filteringCmd"
|
||||
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
|
||||
# File completion for directories only
|
||||
local subDir
|
||||
local subdir
|
||||
subdir="${completions[1]}"
|
||||
if [ -n "$subdir" ]; then
|
||||
__rclone_debug "Listing directories in $subdir"
|
||||
|
@ -143,7 +178,7 @@ _rclone()
|
|||
return $result
|
||||
else
|
||||
__rclone_debug "Calling _describe"
|
||||
if eval _describe "completions" completions $flagPrefix $noSpace; then
|
||||
if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then
|
||||
__rclone_debug "_describe found some completions"
|
||||
|
||||
# Return the success of having called _describe
|
||||
|
@ -173,5 +208,5 @@ _rclone()
|
|||
|
||||
# don't run the completion function when being source-ed or eval-ed
|
||||
if [ "$funcstack[1]" = "_rclone" ]; then
|
||||
_rclone
|
||||
_rclone
|
||||
fi
|
||||
|
|
|
@ -23,4 +23,4 @@ gen chezmoi completion zsh
|
|||
gen rye self completion -s zsh
|
||||
gen gh completion -s zsh
|
||||
gen pixi completion -s zsh
|
||||
gen rclone completion zsh
|
||||
gen rclone completion zsh -
|
||||
|
|
Loading…
Reference in a new issue