diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-18 00:08:23 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-18 00:10:03 +0200 |
| commit | 05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch) | |
| tree | cf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/symfony/console/Resources/completion.zsh | |
| parent | 32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff) | |
| download | AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2 AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip | |
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/symfony/console/Resources/completion.zsh')
| -rw-r--r-- | vendor/symfony/console/Resources/completion.zsh | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/vendor/symfony/console/Resources/completion.zsh b/vendor/symfony/console/Resources/completion.zsh deleted file mode 100644 index ff76fe5..0000000 --- a/vendor/symfony/console/Resources/completion.zsh +++ /dev/null | |||
| @@ -1,82 +0,0 @@ | |||
| 1 | #compdef {{ COMMAND_NAME }} | ||
| 2 | |||
| 3 | # This file is part of the Symfony package. | ||
| 4 | # | ||
| 5 | # (c) Fabien Potencier <fabien@symfony.com> | ||
| 6 | # | ||
| 7 | # For the full copyright and license information, please view | ||
| 8 | # https://symfony.com/doc/current/contributing/code/license.html | ||
| 9 | |||
| 10 | # | ||
| 11 | # zsh completions for {{ COMMAND_NAME }} | ||
| 12 | # | ||
| 13 | # References: | ||
| 14 | # - https://github.com/spf13/cobra/blob/master/zsh_completions.go | ||
| 15 | # - https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Resources/completion.bash | ||
| 16 | # | ||
| 17 | _sf_{{ COMMAND_NAME }}() { | ||
| 18 | local lastParam flagPrefix requestComp out comp | ||
| 19 | local -a completions | ||
| 20 | |||
| 21 | # The user could have moved the cursor backwards on the command-line. | ||
| 22 | # We need to trigger completion from the $CURRENT location, so we need | ||
| 23 | # to truncate the command-line ($words) up to the $CURRENT location. | ||
| 24 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) | ||
| 25 | words=("${=words[1,CURRENT]}") lastParam=${words[-1]} | ||
| 26 | |||
| 27 | # For zsh, when completing a flag with an = (e.g., {{ COMMAND_NAME }} -n=<TAB>) | ||
| 28 | # completions must be prefixed with the flag | ||
| 29 | setopt local_options BASH_REMATCH | ||
| 30 | if [[ "${lastParam}" =~ '-.*=' ]]; then | ||
| 31 | # We are dealing with a flag with an = | ||
| 32 | flagPrefix="-P ${BASH_REMATCH}" | ||
| 33 | fi | ||
| 34 | |||
| 35 | # Prepare the command to obtain completions | ||
| 36 | requestComp="${words[0]} ${words[1]} _complete --no-interaction -szsh -a{{ VERSION }} -c$((CURRENT-1))" i="" | ||
| 37 | for w in ${words[@]}; do | ||
| 38 | w=$(printf -- '%b' "$w") | ||
| 39 | # remove quotes from typed values | ||
| 40 | quote="${w:0:1}" | ||
| 41 | if [ "$quote" = \' ]; then | ||
| 42 | w="${w%\'}" | ||
| 43 | w="${w#\'}" | ||
| 44 | elif [ "$quote" = \" ]; then | ||
| 45 | w="${w%\"}" | ||
| 46 | w="${w#\"}" | ||
| 47 | fi | ||
| 48 | # empty values are ignored | ||
| 49 | if [ ! -z "$w" ]; then | ||
| 50 | i="${i}-i${w} " | ||
| 51 | fi | ||
| 52 | done | ||
| 53 | |||
| 54 | # Ensure at least 1 input | ||
| 55 | if [ "${i}" = "" ]; then | ||
| 56 | requestComp="${requestComp} -i\" \"" | ||
| 57 | else | ||
| 58 | requestComp="${requestComp} ${i}" | ||
| 59 | fi | ||
| 60 | |||
| 61 | # Use eval to handle any environment variables and such | ||
| 62 | out=$(eval ${requestComp} 2>/dev/null) | ||
| 63 | |||
| 64 | while IFS='\n' read -r comp; do | ||
| 65 | if [ -n "$comp" ]; then | ||
| 66 | # If requested, completions are returned with a description. | ||
| 67 | # The description is preceded by a TAB character. | ||
| 68 | # For zsh's _describe, we need to use a : instead of a TAB. | ||
| 69 | # We first need to escape any : as part of the completion itself. | ||
| 70 | comp=${comp//:/\\:} | ||
| 71 | local tab=$(printf '\t') | ||
| 72 | comp=${comp//$tab/:} | ||
| 73 | completions+=${comp} | ||
| 74 | fi | ||
| 75 | done < <(printf "%s\n" "${out[@]}") | ||
| 76 | |||
| 77 | # Let inbuilt _describe handle completions | ||
| 78 | eval _describe "completions" completions $flagPrefix | ||
| 79 | return $? | ||
| 80 | } | ||
| 81 | |||
| 82 | compdef _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} | ||
