aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 11:19:03 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 11:19:03 +0900
commit6051927c8fa32cfffa102d2a170c5a6cf747a1b9 (patch)
tree3fe6769c90cb03ca8f1b9b825e38ad459182361e /crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash
parente3e8806aec771e482899ed3470e920f7b291fa95 (diff)
downloadphp-shirabe-6051927c8fa32cfffa102d2a170c5a6cf747a1b9.tar.gz
php-shirabe-6051927c8fa32cfffa102d2a170c5a6cf747a1b9.tar.zst
php-shirabe-6051927c8fa32cfffa102d2a170c5a6cf747a1b9.zip
refactor(symfony-console): extract symfony/console into the shirabe-symfony-console crate
Move `Symfony\Component\Console` out of shirabe-external-packages and into its own crate, so the path is `shirabe_symfony_console::application::Application` instead of `shirabe_external_packages::symfony::console::application::Application`. The `delegate_to_inner!` and `delegate_command_trait_impls_to_inner!` macros move with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash84
1 files changed, 0 insertions, 84 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash b/crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash
deleted file mode 100644
index bb44037b..00000000
--- a/crates/shirabe-external-packages/src/symfony/console/Resources/completion.bash
+++ /dev/null
@@ -1,84 +0,0 @@
-# This file is part of the Symfony package.
-#
-# (c) Fabien Potencier <fabien@symfony.com>
-#
-# For the full copyright and license information, please view
-# https://symfony.com/doc/current/contributing/code/license.html
-
-_sf_{{ COMMAND_NAME }}() {
- # Use newline as only separator to allow space in completion values
- local IFS=$'\n'
- local sf_cmd="${COMP_WORDS[0]}"
-
- # for an alias, get the real script behind it
- sf_cmd_type=$(type -t $sf_cmd)
- if [[ $sf_cmd_type == "alias" ]]; then
- sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/")
- elif [[ $sf_cmd_type == "file" ]]; then
- sf_cmd=$(type -p $sf_cmd)
- fi
-
- if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then
- return 1
- fi
-
- local cur prev words cword
- _get_comp_words_by_ref -n := cur prev words cword
-
- local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S{{ VERSION }}")
- for w in ${words[@]}; do
- w=$(printf -- '%b' "$w")
- # remove quotes from typed values
- quote="${w:0:1}"
- if [ "$quote" == \' ]; then
- w="${w%\'}"
- w="${w#\'}"
- elif [ "$quote" == \" ]; then
- w="${w%\"}"
- w="${w#\"}"
- fi
- # empty values are ignored
- if [ ! -z "$w" ]; then
- completecmd+=("-i$w")
- fi
- done
-
- local sfcomplete
- if sfcomplete=$(${completecmd[@]} 2>&1); then
- local quote suggestions
- quote=${cur:0:1}
-
- # Use single quotes by default if suggestions contains backslash (FQCN)
- if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then
- quote=\'
- fi
-
- if [ "$quote" == \' ]; then
- # single quotes: no additional escaping (does not accept ' in values)
- suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done)
- elif [ "$quote" == \" ]; then
- # double quotes: double escaping for \ $ ` "
- suggestions=$(for s in $sfcomplete; do
- s=${s//\\/\\\\}
- s=${s//\$/\\\$}
- s=${s//\`/\\\`}
- s=${s//\"/\\\"}
- printf $'%q%q%q\n' "$quote" "$s" "$quote";
- done)
- else
- # no quotes: double escaping
- suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done)
- fi
- COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur")))
- __ltrim_colon_completions "$cur"
- else
- if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then
- >&2 echo
- >&2 echo $sfcomplete
- fi
-
- return 1
- fi
-}
-
-complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }}