@shell-shock/plugin-completions 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/bash-config-command.cjs +6 -120
- package/dist/components/bash-config-command.mjs +6 -119
- package/dist/components/bash-config-command.mjs.map +1 -1
- package/dist/components/bash-script-command.cjs +5 -105
- package/dist/components/bash-script-command.mjs +5 -104
- package/dist/components/bash-script-command.mjs.map +1 -1
- package/dist/components/bash-shared.cjs +13 -77
- package/dist/components/bash-shared.mjs +13 -76
- package/dist/components/bash-shared.mjs.map +1 -1
- package/dist/components/fish-config-command.cjs +6 -120
- package/dist/components/fish-config-command.mjs +6 -119
- package/dist/components/fish-config-command.mjs.map +1 -1
- package/dist/components/fish-script-command.cjs +4 -104
- package/dist/components/fish-script-command.mjs +4 -103
- package/dist/components/fish-script-command.mjs.map +1 -1
- package/dist/components/fish-shared.cjs +77 -141
- package/dist/components/fish-shared.mjs +77 -140
- package/dist/components/fish-shared.mjs.map +1 -1
- package/dist/components/index.cjs +1 -26
- package/dist/components/index.mjs +1 -14
- package/dist/components/powershell-config-command.cjs +6 -116
- package/dist/components/powershell-config-command.mjs +6 -115
- package/dist/components/powershell-config-command.mjs.map +1 -1
- package/dist/components/powershell-script-command.cjs +4 -104
- package/dist/components/powershell-script-command.mjs +4 -103
- package/dist/components/powershell-script-command.mjs.map +1 -1
- package/dist/components/powershell-shared.cjs +37 -101
- package/dist/components/powershell-shared.mjs +37 -100
- package/dist/components/powershell-shared.mjs.map +1 -1
- package/dist/components/zsh-config-command.cjs +6 -120
- package/dist/components/zsh-config-command.mjs +6 -119
- package/dist/components/zsh-config-command.mjs.map +1 -1
- package/dist/components/zsh-script-command.cjs +6 -108
- package/dist/components/zsh-script-command.mjs +6 -107
- package/dist/components/zsh-script-command.mjs.map +1 -1
- package/dist/components/zsh-shared.cjs +42 -106
- package/dist/components/zsh-shared.mjs +42 -105
- package/dist/components/zsh-shared.mjs.map +1 -1
- package/dist/helpers/complete-command.cjs +1 -10
- package/dist/helpers/complete-command.mjs +1 -8
- package/dist/helpers/complete-command.mjs.map +1 -1
- package/dist/helpers/completion-directive-constants.cjs +1 -16
- package/dist/helpers/completion-directive-constants.mjs +1 -14
- package/dist/helpers/completion-directive-constants.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -6
- package/dist/helpers/index.mjs +1 -4
- package/dist/index.cjs +1 -303
- package/dist/index.mjs +1 -301
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -4
- package/dist/types/index.mjs +1 -3
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/shell-type.cjs +1 -12
- package/dist/types/shell-type.mjs +1 -10
- package/dist/types/shell-type.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zsh-shared.mjs","names":[],"sources":["../../src/components/zsh-shared.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppBin } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport { CompletionDirective } from \"../helpers\";\nimport { EXEC_COMMAND } from \"../helpers/complete-command\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Zsh Completions generation for the Shell Shock project.\n */\nexport function ZshCompletionsShared() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n const name = computed(() => snakeCase(bin.value));\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"completions\", \"zsh\", \"shared.ts\")}\n builtinImports={{\n console: [\n \"white\",\n \"green\",\n \"red\",\n \"bold\",\n \"cyan\",\n \"gray\",\n \"magenta\",\n \"magentaBright\",\n \"greenBright\",\n \"redBright\",\n \"cyanBright\",\n \"dim\"\n ]\n }}>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"SHELL_COMPLETIONS\"\n initializer={code` \\`__${name.value}_debug() {\n local file=\"$BASH_COMP_DEBUG_FILE\"\n if [[ -n \\\\\\${file} ]]; then\n echo \"$*\" >> \"\\\\\\${file}\"\n fi\n}\n\n_${name.value}() {\n local shellCompDirectiveError=${\n CompletionDirective.CompletionDirectiveError\n }\n local shellCompDirectiveNoSpace=${\n CompletionDirective.CompletionDirectiveNoSpace\n }\n local shellCompDirectiveNoFileComp=${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n local shellCompDirectiveFilterFileExt=${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n local shellCompDirectiveFilterDirs=${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n local shellCompDirectiveKeepOrder=${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n\n local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder\n local -a completions\n\n __${name.value}_debug \"\\\\n========= starting completion logic ==========\"\n __${name.value}_debug \"CURRENT: \\\\\\${CURRENT}, words[*]: \\\\\\${words[*]}\"\n\n # The user could have moved the cursor backwards on the command-line.\n # We need to trigger completion from the $CURRENT location, so we need\n # to truncate the command-line ($words) up to the $CURRENT location.\n # (We cannot use $CURSOR as its value does not work when a command is an alias.)\n words=( \"\\\\\\${=words[1,CURRENT]}\" )\n __${name.value}_debug \"Truncated words[*]: \\\\\\${words[*]},\"\n\n lastParam=\\\\\\${words[-1]}\n lastChar=\\\\\\${lastParam[-1]}\n __${name.value}_debug \"lastParam: \\\\\\${lastParam}, lastChar: \\\\\\${lastChar}\"\n # For zsh, when completing a flag with an = (e.g., ${bin.value} -n=<TAB>)\n # completions must be prefixed with the flag\n setopt local_options BASH_REMATCH\n if [[ \"\\\\\\${lastParam}\" =~ '-.*=' ]]; then\n # We are dealing with a flag with an =\n flagPrefix=\"-P \\\\\\${BASH_REMATCH}\"\n fi\n\n # Prepare the command to obtain completions, ensuring arguments are quoted for eval\n local -a args_to_quote=(\"\\\\\\${(@)words[2,-1]}\")\n if [ \"\\\\\\${lastChar}\" = \"\" ]; then\n # If the last parameter is complete (there is a space following it)\n # We add an extra empty parameter so we can indicate this to the go completion code.\n __${name.value}_debug \"Adding extra empty parameter\"\n args_to_quote+=(\"\")\n fi\n\n # Use Zsh's (q) flag to quote each argument safely for eval\n local quoted_args=(\"\\\\\\${(@q)args_to_quote}\")\n\n # Join the main command and the quoted arguments into a single string for eval\n requestComp=\"${EXEC_COMMAND} complete -- \\\\\\${quoted_args[*]}\"\n\n __${name.value}_debug \"About to call: eval \\\\\\${requestComp}\"\n\n # Use eval to handle any environment variables and such\n out=$(eval \\\\\\${requestComp} 2>/dev/null)\n __${name.value}_debug \"completion output: \\\\\\${out}\"\n\n # Extract the directive integer following a : from the last line\n local lastLine\n while IFS='\\n' read -r line; do\n lastLine=\\\\\\${line}\n done < <(printf \"%s\\n\" \"\\\\\\${out[@]}\")\n __${name.value}_debug \"last line: \\\\\\${lastLine}\"\n\n if [ \"\\\\\\${lastLine[1]}\" = : ]; then\n directive=\\\\\\${lastLine[2,-1]}\n # Remove the directive including the : and the newline\n local suffix\n (( suffix=\\\\\\${#lastLine}+2))\n out=\\\\\\${out[1,-$suffix]}\n else\n # There is no directive specified. Leave $out as is.\n __${name.value}_debug \"No directive found. Setting to default\"\n directive=0\n fi\n\n __${name.value}_debug \"directive: \\\\\\${directive}\"\n __${name.value}_debug \"completions: \\\\\\${out}\"\n __${name.value}_debug \"flagPrefix: \\\\\\${flagPrefix}\"\n\n if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then\n __${name.value}_debug \"Completion received error. Ignoring completions.\"\n return\n fi\n\n local activeHelpMarker=\"%\"\n local endIndex=\\\\\\${#activeHelpMarker}\n local startIndex=$((\\\\\\${#activeHelpMarker}+1))\n local hasActiveHelp=0\n while IFS='\\n' read -r comp; do\n # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)\n if [ \"\\\\\\${comp[1,$endIndex]}\" = \"$activeHelpMarker\" ];then\n __${name.value}_debug \"ActiveHelp found: $comp\"\n comp=\"\\\\\\${comp[$startIndex,-1]}\"\n if [ -n \"$comp\" ]; then\n compadd -x \"\\\\\\${comp}\"\n __${name.value}_debug \"ActiveHelp will need delimiter\"\n hasActiveHelp=1\n fi\n continue\n fi\n\n if [ -n \"$comp\" ]; then\n # If requested, completions are returned with a description.\n # The description is preceded by a TAB character.\n # For zsh's _describe, we need to use a : instead of a TAB.\n # We first need to escape any : as part of the completion itself.\n comp=\\\\\\${comp//:/\\\\:}\n\n local tab=\"$(printf '\\\\t')\"\n comp=\\\\\\${comp//$tab/:}\n\n __${name.value}_debug \"Adding completion: \\\\\\${comp}\"\n completions+=\\\\\\${comp}\n lastComp=$comp\n fi\n done < <(printf \"%s\\n\" \"\\\\\\${out[@]}\")\n\n # Add a delimiter after the activeHelp statements, but only if:\n # - there are completions following the activeHelp statements, or\n # - file completion will be performed (so there will be choices after the activeHelp)\n if [ $hasActiveHelp -eq 1 ]; then\n if [ \\\\\\${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then\n __${name.value}_debug \"Adding activeHelp delimiter\"\n compadd -x \"--\"\n hasActiveHelp=0\n fi\n fi\n\n if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then\n __${name.value}_debug \"Activating nospace.\"\n noSpace=\"-S ''\"\n fi\n\n if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then\n __${name.value}_debug \"Activating keep order.\"\n keepOrder=\"-V\"\n fi\n\n if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then\n # File extension filtering\n local filteringCmd\n filteringCmd='_files'\n for filter in \\\\\\${completions[@]}; do\n if [ \\\\\\${filter[1]} != '*' ]; then\n # zsh requires a glob pattern to do file filtering\n filter=\"\\\\*.$filter\"\n fi\n filteringCmd+=\" -g $filter\"\n done\n filteringCmd+=\" \\\\\\${flagPrefix}\"\n\n __${name.value}_debug \"File filtering command: $filteringCmd\"\n _arguments '*:filename:'\"$filteringCmd\"\n elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then\n # File completion for directories only\n local subdir\n subdir=\"\\\\\\${completions[1]}\"\n if [ -n \"$subdir\" ]; then\n __${name.value}_debug \"Listing directories in $subdir\"\n pushd \"\\\\\\${subdir}\" >/dev/null 2>&1\n else\n __${name.value}_debug \"Listing directories in .\"\n fi\n\n local result\n _arguments '*:dirname:_files -/'\" \\\\\\${flagPrefix}\"\n result=$?\n if [ -n \"$subdir\" ]; then\n popd >/dev/null 2>&1\n fi\n return $result\n else\n __${name.value}_debug \"Calling _describe\"\n if eval _describe $keepOrder \"completions\" completions -Q \\\\\\${flagPrefix} \\\\\\${noSpace}; then\n __${name.value}_debug \"_describe found some completions\"\n\n # Return the success of having called _describe\n return 0\n else\n __${name.value}_debug \"_describe did not find completions.\"\n __${name.value}_debug \"Checking if we should do file completion.\"\n if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then\n __${name.value}_debug \"deactivating file completion\"\n\n # Return 0 to indicate completion is finished and prevent zsh from\n # trying other completion algorithms (which could cause hanging).\n # We use NoFileComp directive to explicitly disable file completion.\n return 0\n else\n # Perform file completion\n __${name.value}_debug \"Activating file completion\"\n\n # We must return the result of this command, so it must be the\n # last command, or else we must store its result to return it.\n _arguments '*:filename:_files'\" \\\\\\${flagPrefix}\"\n fi\n fi\n fi\n}\n\n# don't run the completion function when being sourced or eval-ed\nif [ \"\\\\\\${funcstack[1]}\" = \"_${name.value}\" ]; then\n _${name.value}\nfi\n\\`; `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"SHELL_COMPLETIONS_DISPLAY\"\n initializer={code` SHELL_COMPLETIONS.split(\"\\\\n\").map(line => {\n if (!line.trim()) {\n return \"\";\n }\n if (line.trim().startsWith(\"#\")) {\n return \\`\\${dim(line)}\\`;\n }\n\n return white(line).replaceAll(/(?<=\\\\\\$(\\\\{|\\\\()).*(?=(\\\\}\\\\)))/g, green(\"$&\"))\n .replaceAll(/\\\\\".*\\\\\"/g, cyan(\"$&\"))\n .replaceAll(/(\\\\[|\\\\]|\\\\(|\\\\)|\\\\||<|>|\\\\$\\\\(|\\\\$?\\\\{|\\\\}|\\\\+|=|;|:)/g, bold(gray(\"$&\")))\n .replaceAll(/(readonly|complete)\\\\s+/g, green(\"$&\"))\n .replaceAll(/(?<=(readonly|complete)\\\\s+)\\\\w/g, bold(greenBright(\"$&\")))\n .replaceAll(/local\\\\s+/g, red(\"$&\"))\n .replaceAll(/(?<=local\\\\s+)\\\\w/g, bold(redBright(\"$&\")))\n .replaceAll(/(for|while)\\\\s+/g, cyan(\"$&\"))\n .replaceAll(/(?<=for|while\\\\s+)\\\\w/g, bold(cyanBright(\"$&\")))\n .replaceAll(/(return|if|fi|else|elif|then|done)\\\\s+/g, green(\"$&\"))\n .replaceAll(/__\\\\w/g, bold(magentaBright(\"$&\")))\n .replaceAll(/(?<=\\\\s)(-\\\\w|--\\\\w[\\\\w-]*)(?=\\\\s|$)/g, bold(magenta(\"$&\")));\n\n }).join(\"\\\\n\"); `}\n />\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAgB,uBAAgB;;CAE9B,MAAM,MAAM,eAAe,UAAU,QAAQ,CAAC;CAC9C,MAAM,OAAO,eAAe,UAAU,IAAI,MAAM,CAAC;;EAEjD,IAAM,OAAC;AACJ,UAAA,UAAA,QAAA,WAAA,eAAA,OAAA,YAAA;;EAED,gBAAgB,EACd,SAAS;GAAC;GAAC;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA,EACZ;EACD,IAAI,WAAS;AACX,UAAK;IAAG,gBAAC,SAAA,EAAA,CAAA;IAAA,gBAAA,gBAAA;KACP,SAAQ;KACR,UAAQ;KACR,MAAG;KACH,IAAG,cAAQ;AACT,aAAC,IAAA,QAAc,KAAA,MAAA;;;;;;;GAOtB,KAAI,MAAO;oCACP,oBAAA,yBAAA;sCACC,oBAAA,2BAAA;yCACA,oBAAA,8BAAA;4CACuB,oBAAA,iCAAA;yCACO,oBAAe,8BAAA;wCAChB,oBAAA,6BAAA;;;;;;QAM7B,KAAK,MAAI;;;;;;;QAOb,KAAM,MAAA;;;;QAIJ,KAAA,MAAA;yDACF,IAAA,MAAA;;;;;;;;;;;;;;;;;;;;;mBAqBe,aAAS;;QAEpB,KAAK,MAAM;;;;QAIX,KAAK,MAAG;;;;;;;QAOR,KAAK,MAAE;;;;;;;;;;YAUJ,KAAI,MAAK;;;;;QAKd,KAAI,MAAQ;QACV,KAAE,MAAS;;;YAGb,KAAW,MAAC;;;;;;;;;;;gBAWP,KAAU,MAAG;;;;oBAIP,KAAM,MAAQ;;;;;;;;;;;;;;;;gBAgBrB,KAAA,MAAc;;;;;;;;;;;gBAWZ,KAAA,MAAA;;;;;;;YAOA,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA6BP,KAAC,MAAM;;;;;;;;;;;;;;YAcf,KAAA,MAAA;;;;;;;gBAOM,KAAA,MAAA;gBACE,KAAK,MAAA;;oBAED,KAAC,MAAM;;;;;;;;oBAQX,KAAA,MAAA;;;;;;;;;;;gCAWG,KAAA,MAAA;OACZ,KAAC,MAAA;;;;KAID,CAAC;IAAE,gBAAe,SAAY,EAAE,CAAA;IAAA,gBAAkB,gBAAU;;KAE3D,SAAS;KACT,MAAM;KACN,aAAa,IAAI;;;;;;;;;;;;;;;;;;;;;;KAsBlB,CAAC;IAAA;;EAEL,CAAC"}
|
|
1
|
+
{"version":3,"file":"zsh-shared.mjs","names":[],"sources":["../../src/components/zsh-shared.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppBin } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport { CompletionDirective } from \"../helpers\";\nimport { EXEC_COMMAND } from \"../helpers/complete-command\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Zsh Completions generation for the Shell Shock project.\n */\nexport function ZshCompletionsShared() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n const name = computed(() => snakeCase(bin.value));\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"completions\", \"zsh\", \"shared.ts\")}\n builtinImports={{\n console: [\n \"white\",\n \"green\",\n \"red\",\n \"bold\",\n \"cyan\",\n \"gray\",\n \"magenta\",\n \"magentaBright\",\n \"greenBright\",\n \"redBright\",\n \"cyanBright\",\n \"dim\"\n ]\n }}>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"SHELL_COMPLETIONS\"\n initializer={code` \\`__${name.value}_debug() {\n local file=\"$BASH_COMP_DEBUG_FILE\"\n if [[ -n \\\\\\${file} ]]; then\n echo \"$*\" >> \"\\\\\\${file}\"\n fi\n}\n\n_${name.value}() {\n local shellCompDirectiveError=${\n CompletionDirective.CompletionDirectiveError\n }\n local shellCompDirectiveNoSpace=${\n CompletionDirective.CompletionDirectiveNoSpace\n }\n local shellCompDirectiveNoFileComp=${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n local shellCompDirectiveFilterFileExt=${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n local shellCompDirectiveFilterDirs=${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n local shellCompDirectiveKeepOrder=${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n\n local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder\n local -a completions\n\n __${name.value}_debug \"\\\\n========= starting completion logic ==========\"\n __${name.value}_debug \"CURRENT: \\\\\\${CURRENT}, words[*]: \\\\\\${words[*]}\"\n\n # The user could have moved the cursor backwards on the command-line.\n # We need to trigger completion from the $CURRENT location, so we need\n # to truncate the command-line ($words) up to the $CURRENT location.\n # (We cannot use $CURSOR as its value does not work when a command is an alias.)\n words=( \"\\\\\\${=words[1,CURRENT]}\" )\n __${name.value}_debug \"Truncated words[*]: \\\\\\${words[*]},\"\n\n lastParam=\\\\\\${words[-1]}\n lastChar=\\\\\\${lastParam[-1]}\n __${name.value}_debug \"lastParam: \\\\\\${lastParam}, lastChar: \\\\\\${lastChar}\"\n # For zsh, when completing a flag with an = (e.g., ${bin.value} -n=<TAB>)\n # completions must be prefixed with the flag\n setopt local_options BASH_REMATCH\n if [[ \"\\\\\\${lastParam}\" =~ '-.*=' ]]; then\n # We are dealing with a flag with an =\n flagPrefix=\"-P \\\\\\${BASH_REMATCH}\"\n fi\n\n # Prepare the command to obtain completions, ensuring arguments are quoted for eval\n local -a args_to_quote=(\"\\\\\\${(@)words[2,-1]}\")\n if [ \"\\\\\\${lastChar}\" = \"\" ]; then\n # If the last parameter is complete (there is a space following it)\n # We add an extra empty parameter so we can indicate this to the go completion code.\n __${name.value}_debug \"Adding extra empty parameter\"\n args_to_quote+=(\"\")\n fi\n\n # Use Zsh's (q) flag to quote each argument safely for eval\n local quoted_args=(\"\\\\\\${(@q)args_to_quote}\")\n\n # Join the main command and the quoted arguments into a single string for eval\n requestComp=\"${EXEC_COMMAND} complete -- \\\\\\${quoted_args[*]}\"\n\n __${name.value}_debug \"About to call: eval \\\\\\${requestComp}\"\n\n # Use eval to handle any environment variables and such\n out=$(eval \\\\\\${requestComp} 2>/dev/null)\n __${name.value}_debug \"completion output: \\\\\\${out}\"\n\n # Extract the directive integer following a : from the last line\n local lastLine\n while IFS='\\n' read -r line; do\n lastLine=\\\\\\${line}\n done < <(printf \"%s\\n\" \"\\\\\\${out[@]}\")\n __${name.value}_debug \"last line: \\\\\\${lastLine}\"\n\n if [ \"\\\\\\${lastLine[1]}\" = : ]; then\n directive=\\\\\\${lastLine[2,-1]}\n # Remove the directive including the : and the newline\n local suffix\n (( suffix=\\\\\\${#lastLine}+2))\n out=\\\\\\${out[1,-$suffix]}\n else\n # There is no directive specified. Leave $out as is.\n __${name.value}_debug \"No directive found. Setting to default\"\n directive=0\n fi\n\n __${name.value}_debug \"directive: \\\\\\${directive}\"\n __${name.value}_debug \"completions: \\\\\\${out}\"\n __${name.value}_debug \"flagPrefix: \\\\\\${flagPrefix}\"\n\n if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then\n __${name.value}_debug \"Completion received error. Ignoring completions.\"\n return\n fi\n\n local activeHelpMarker=\"%\"\n local endIndex=\\\\\\${#activeHelpMarker}\n local startIndex=$((\\\\\\${#activeHelpMarker}+1))\n local hasActiveHelp=0\n while IFS='\\n' read -r comp; do\n # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)\n if [ \"\\\\\\${comp[1,$endIndex]}\" = \"$activeHelpMarker\" ];then\n __${name.value}_debug \"ActiveHelp found: $comp\"\n comp=\"\\\\\\${comp[$startIndex,-1]}\"\n if [ -n \"$comp\" ]; then\n compadd -x \"\\\\\\${comp}\"\n __${name.value}_debug \"ActiveHelp will need delimiter\"\n hasActiveHelp=1\n fi\n continue\n fi\n\n if [ -n \"$comp\" ]; then\n # If requested, completions are returned with a description.\n # The description is preceded by a TAB character.\n # For zsh's _describe, we need to use a : instead of a TAB.\n # We first need to escape any : as part of the completion itself.\n comp=\\\\\\${comp//:/\\\\:}\n\n local tab=\"$(printf '\\\\t')\"\n comp=\\\\\\${comp//$tab/:}\n\n __${name.value}_debug \"Adding completion: \\\\\\${comp}\"\n completions+=\\\\\\${comp}\n lastComp=$comp\n fi\n done < <(printf \"%s\\n\" \"\\\\\\${out[@]}\")\n\n # Add a delimiter after the activeHelp statements, but only if:\n # - there are completions following the activeHelp statements, or\n # - file completion will be performed (so there will be choices after the activeHelp)\n if [ $hasActiveHelp -eq 1 ]; then\n if [ \\\\\\${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then\n __${name.value}_debug \"Adding activeHelp delimiter\"\n compadd -x \"--\"\n hasActiveHelp=0\n fi\n fi\n\n if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then\n __${name.value}_debug \"Activating nospace.\"\n noSpace=\"-S ''\"\n fi\n\n if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then\n __${name.value}_debug \"Activating keep order.\"\n keepOrder=\"-V\"\n fi\n\n if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then\n # File extension filtering\n local filteringCmd\n filteringCmd='_files'\n for filter in \\\\\\${completions[@]}; do\n if [ \\\\\\${filter[1]} != '*' ]; then\n # zsh requires a glob pattern to do file filtering\n filter=\"\\\\*.$filter\"\n fi\n filteringCmd+=\" -g $filter\"\n done\n filteringCmd+=\" \\\\\\${flagPrefix}\"\n\n __${name.value}_debug \"File filtering command: $filteringCmd\"\n _arguments '*:filename:'\"$filteringCmd\"\n elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then\n # File completion for directories only\n local subdir\n subdir=\"\\\\\\${completions[1]}\"\n if [ -n \"$subdir\" ]; then\n __${name.value}_debug \"Listing directories in $subdir\"\n pushd \"\\\\\\${subdir}\" >/dev/null 2>&1\n else\n __${name.value}_debug \"Listing directories in .\"\n fi\n\n local result\n _arguments '*:dirname:_files -/'\" \\\\\\${flagPrefix}\"\n result=$?\n if [ -n \"$subdir\" ]; then\n popd >/dev/null 2>&1\n fi\n return $result\n else\n __${name.value}_debug \"Calling _describe\"\n if eval _describe $keepOrder \"completions\" completions -Q \\\\\\${flagPrefix} \\\\\\${noSpace}; then\n __${name.value}_debug \"_describe found some completions\"\n\n # Return the success of having called _describe\n return 0\n else\n __${name.value}_debug \"_describe did not find completions.\"\n __${name.value}_debug \"Checking if we should do file completion.\"\n if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then\n __${name.value}_debug \"deactivating file completion\"\n\n # Return 0 to indicate completion is finished and prevent zsh from\n # trying other completion algorithms (which could cause hanging).\n # We use NoFileComp directive to explicitly disable file completion.\n return 0\n else\n # Perform file completion\n __${name.value}_debug \"Activating file completion\"\n\n # We must return the result of this command, so it must be the\n # last command, or else we must store its result to return it.\n _arguments '*:filename:_files'\" \\\\\\${flagPrefix}\"\n fi\n fi\n fi\n}\n\n# don't run the completion function when being sourced or eval-ed\nif [ \"\\\\\\${funcstack[1]}\" = \"_${name.value}\" ]; then\n _${name.value}\nfi\n\\`; `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"SHELL_COMPLETIONS_DISPLAY\"\n initializer={code` SHELL_COMPLETIONS.split(\"\\\\n\").map(line => {\n if (!line.trim()) {\n return \"\";\n }\n if (line.trim().startsWith(\"#\")) {\n return \\`\\${dim(line)}\\`;\n }\n\n return white(line).replaceAll(/(?<=\\\\\\$(\\\\{|\\\\()).*(?=(\\\\}\\\\)))/g, green(\"$&\"))\n .replaceAll(/\\\\\".*\\\\\"/g, cyan(\"$&\"))\n .replaceAll(/(\\\\[|\\\\]|\\\\(|\\\\)|\\\\||<|>|\\\\$\\\\(|\\\\$?\\\\{|\\\\}|\\\\+|=|;|:)/g, bold(gray(\"$&\")))\n .replaceAll(/(readonly|complete)\\\\s+/g, green(\"$&\"))\n .replaceAll(/(?<=(readonly|complete)\\\\s+)\\\\w/g, bold(greenBright(\"$&\")))\n .replaceAll(/local\\\\s+/g, red(\"$&\"))\n .replaceAll(/(?<=local\\\\s+)\\\\w/g, bold(redBright(\"$&\")))\n .replaceAll(/(for|while)\\\\s+/g, cyan(\"$&\"))\n .replaceAll(/(?<=for|while\\\\s+)\\\\w/g, bold(cyanBright(\"$&\")))\n .replaceAll(/(return|if|fi|else|elif|then|done)\\\\s+/g, green(\"$&\"))\n .replaceAll(/__\\\\w/g, bold(magentaBright(\"$&\")))\n .replaceAll(/(?<=\\\\s)(-\\\\w|--\\\\w[\\\\w-]*)(?=\\\\s|$)/g, bold(magenta(\"$&\")));\n\n }).join(\"\\\\n\"); `}\n />\n </TypescriptFile>\n );\n}\n"],"mappings":"osBAgCA,SAAE,GAAA,CACF,IAAO,EAAS,GAAA,CACR,EAAA,MAAU,EAAc,EAAA,CAAA,qBAE9B,OAAM,EAAmB,EAAY,CACrC,IAAM,MAAO,wDAGX,eAAC,CACC,QAAM,CAAA,QAAU,QAAQ,MAAW,OAAC,OAAe,OAAO,UAAW,gBAAA,cAAA,YAAA,aAAA,MAAA,CACtE,CACD,IAAI,UAAS,CACX,MAAK,CAAA,EAAM,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACT,MAAS,GACT,OAAO,GACP,KAAG,oBACH,IAAG,aAAK,CACN,MAAM,EAAA,QAAA,EAAA,MAAA;;;;;;;GAOb,EAAK,MAAA;oCACA,EAAA,yBAAA;sCACQ,EAAA,2BAAA;yCACT,EAAA,8BAAA;4CACC,EAAA,iCAAA;yCACA,EAAA,8BAAA;wCACuB,EAAA,6BAAA;;;;;QAK3B,EAAA,MAAA;QACJ,EAAA,MAAA;;;;;;;QAOM,EAAA,MAAA;;;;QAIF,EAAA,MAAA;yDACuC,EAAA,MAAA;;;;;;;;;;;;;YAa/B,EAAC,MAAM;;;;;;;;mBAQA,EAAQ;;QAEvB,EAAS,MAAM;;;;QAIb,EAAA,MAAY;;;;;;;QAOZ,EAAO,MAAK;;;;;;;;;;YAUR,EAAA,MAAa;;;;;QAKf,EAAK,MAAM;;;;YAIP,EAAC,MAAM;;;;;;;;;;;gBAWH,EAAK,MAAA;;;;oBAIjB,EAAA,MAAA;;;;;;;;;;;;;;;;gBAgBM,EAAW,MAAI;;;;;;;;;;;gBAWT,EAAA,MAAA;;;;;;;YAOJ,EAAK,MAAC;;;;;YAKN,EAAK,MAAM;;;;;;;;;;;;;;;;;YAiBf,EAAA,MAAA;;;;;;;;;;gBAUA,EAAa,MAAA;;;;;;;;;;;YAWT,EAAA,MAAA;;gBAEJ,EAAA,MAAA;;;;;gBAKM,EAAA,MAAY;gBACX,EAAA,MAAW;;oBAEN,EAAC,MAAA;;;;;;;;oBAQP,EAAA,MAAA;;;;;;;;;;;;OAYP,EAAK,MAAE;;OAIP,CAAC,CAAE,EAAiB,EAAQ,EAAA,CAAA,CAAA,EAAyB,EAAgB,CACpE,OAAU,GACV,MAAQ,oCAER,YAAU,CAAO;;;;;;;;;;;;;;;;;;;;;0BAsBlB,CAAA,CAAA,EAEJ,CAAC"}
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/complete-command.ts
|
|
4
|
-
function quoteIfNeeded(path) {
|
|
5
|
-
return path.includes(" ") ? `'${path}'` : path;
|
|
6
|
-
}
|
|
7
|
-
const EXEC_COMMAND = `${quoteIfNeeded(process.execPath)} ${process.execArgv.map(quoteIfNeeded).join(" ")} ${process.argv.slice(1).map(quoteIfNeeded)[0]}`;
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.EXEC_COMMAND = EXEC_COMMAND;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){return e.includes(` `)?`'${e}'`:e}const t=`${e(process.execPath)} ${process.execArgv.map(e).join(` `)} ${process.argv.slice(1).map(e)[0]}`;exports.EXEC_COMMAND=t;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function quoteIfNeeded(path) {
|
|
3
|
-
return path.includes(" ") ? `'${path}'` : path;
|
|
4
|
-
}
|
|
5
|
-
const EXEC_COMMAND = `${quoteIfNeeded(process.execPath)} ${process.execArgv.map(quoteIfNeeded).join(" ")} ${process.argv.slice(1).map(quoteIfNeeded)[0]}`;
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { EXEC_COMMAND };
|
|
1
|
+
function e(e){return e.includes(` `)?`'${e}'`:e}const t=`${e(process.execPath)} ${process.execArgv.map(e).join(` `)} ${process.argv.slice(1).map(e)[0]}`;export{t as EXEC_COMMAND};
|
|
9
2
|
//# sourceMappingURL=complete-command.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete-command.mjs","names":[],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nfunction quoteIfNeeded(path: string): string {\n return path.includes(\" \") ? `'${path}'` : path;\n}\n\nexport const EXEC_COMMAND = `${quoteIfNeeded(process.execPath)} ${process.execArgv\n .map(quoteIfNeeded)\n .join(\" \")} ${process.argv.slice(1).map(quoteIfNeeded)[0]}`;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"complete-command.mjs","names":[],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nfunction quoteIfNeeded(path: string): string {\n return path.includes(\" \") ? `'${path}'` : path;\n}\n\nexport const EXEC_COMMAND = `${quoteIfNeeded(process.execPath)} ${process.execArgv\n .map(quoteIfNeeded)\n .join(\" \")} ${process.argv.slice(1).map(quoteIfNeeded)[0]}`;\n"],"mappings":"AAkBA,SAAS,EAAc,EAAM,CAC3B,OAAO,EAAK,SAAS,IAAI,CAAG,IAAI,EAAK,GAAK"}
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/completion-directive-constants.ts
|
|
4
|
-
const CompletionDirective = {
|
|
5
|
-
CompletionDirectiveError: 1,
|
|
6
|
-
CompletionDirectiveNoSpace: 2,
|
|
7
|
-
CompletionDirectiveNoFileComp: 4,
|
|
8
|
-
CompletionDirectiveFilterFileExt: 8,
|
|
9
|
-
CompletionDirectiveFilterDirs: 16,
|
|
10
|
-
CompletionDirectiveKeepOrder: 32,
|
|
11
|
-
CompletionDirectiveMaxValue: 64,
|
|
12
|
-
CompletionDirectiveDefault: 0
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
exports.CompletionDirective = CompletionDirective;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e={CompletionDirectiveError:1,CompletionDirectiveNoSpace:2,CompletionDirectiveNoFileComp:4,CompletionDirectiveFilterFileExt:8,CompletionDirectiveFilterDirs:16,CompletionDirectiveKeepOrder:32,CompletionDirectiveMaxValue:64,CompletionDirectiveDefault:0};exports.CompletionDirective=e;
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const CompletionDirective = {
|
|
3
|
-
CompletionDirectiveError: 1,
|
|
4
|
-
CompletionDirectiveNoSpace: 2,
|
|
5
|
-
CompletionDirectiveNoFileComp: 4,
|
|
6
|
-
CompletionDirectiveFilterFileExt: 8,
|
|
7
|
-
CompletionDirectiveFilterDirs: 16,
|
|
8
|
-
CompletionDirectiveKeepOrder: 32,
|
|
9
|
-
CompletionDirectiveMaxValue: 64,
|
|
10
|
-
CompletionDirectiveDefault: 0
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { CompletionDirective };
|
|
1
|
+
const e={CompletionDirectiveError:1,CompletionDirectiveNoSpace:2,CompletionDirectiveNoFileComp:4,CompletionDirectiveFilterFileExt:8,CompletionDirectiveFilterDirs:16,CompletionDirectiveKeepOrder:32,CompletionDirectiveMaxValue:64,CompletionDirectiveDefault:0};export{e as CompletionDirective};
|
|
15
2
|
//# sourceMappingURL=completion-directive-constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion-directive-constants.mjs","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const CompletionDirective = {\n CompletionDirectiveError: 1 << 0,\n CompletionDirectiveNoSpace: 1 << 1,\n CompletionDirectiveNoFileComp: 1 << 2,\n CompletionDirectiveFilterFileExt: 1 << 3,\n CompletionDirectiveFilterDirs: 1 << 4,\n CompletionDirectiveKeepOrder: 1 << 5,\n CompletionDirectiveMaxValue: 1 << 6,\n CompletionDirectiveDefault: 0\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"completion-directive-constants.mjs","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const CompletionDirective = {\n CompletionDirectiveError: 1 << 0,\n CompletionDirectiveNoSpace: 1 << 1,\n CompletionDirectiveNoFileComp: 1 << 2,\n CompletionDirectiveFilterFileExt: 1 << 3,\n CompletionDirectiveFilterDirs: 1 << 4,\n CompletionDirectiveKeepOrder: 1 << 5,\n CompletionDirectiveMaxValue: 1 << 6,\n CompletionDirectiveDefault: 0\n};\n"],"mappings":"AAkBA,MAAa,EAAsB,CACjC,yBAA0B,EAC1B,2BAA4B,EAC5B,8BAA+B,EAC/B,iCAAkC,EAClC,8BAA+B,GAC/B,6BAA8B,GAC9B,4BAA6B,GAC7B,2BAA4B,EAC7B"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_helpers_complete_command = require('./complete-command.cjs');
|
|
3
|
-
const require_helpers_completion_directive_constants = require('./completion-directive-constants.cjs');
|
|
4
|
-
|
|
5
|
-
exports.CompletionDirective = require_helpers_completion_directive_constants.CompletionDirective;
|
|
6
|
-
exports.EXEC_COMMAND = require_helpers_complete_command.EXEC_COMMAND;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./complete-command.cjs`),t=require(`./completion-directive-constants.cjs`);exports.CompletionDirective=t.CompletionDirective,exports.EXEC_COMMAND=e.EXEC_COMMAND;
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CompletionDirective } from "./completion-directive-constants.mjs";
|
|
3
|
-
|
|
4
|
-
export { CompletionDirective, EXEC_COMMAND };
|
|
1
|
+
import{EXEC_COMMAND as e}from"./complete-command.mjs";import{CompletionDirective as t}from"./completion-directive-constants.mjs";export{t as CompletionDirective,e as EXEC_COMMAND};
|
package/dist/index.cjs
CHANGED
|
@@ -1,303 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_components_bash_config_command = require('./components/bash-config-command.cjs');
|
|
3
|
-
const require_components_bash_script_command = require('./components/bash-script-command.cjs');
|
|
4
|
-
const require_components_bash_shared = require('./components/bash-shared.cjs');
|
|
5
|
-
const require_components_fish_config_command = require('./components/fish-config-command.cjs');
|
|
6
|
-
const require_components_fish_script_command = require('./components/fish-script-command.cjs');
|
|
7
|
-
const require_components_fish_shared = require('./components/fish-shared.cjs');
|
|
8
|
-
const require_components_powershell_config_command = require('./components/powershell-config-command.cjs');
|
|
9
|
-
const require_components_powershell_script_command = require('./components/powershell-script-command.cjs');
|
|
10
|
-
const require_components_powershell_shared = require('./components/powershell-shared.cjs');
|
|
11
|
-
const require_components_zsh_config_command = require('./components/zsh-config-command.cjs');
|
|
12
|
-
const require_components_zsh_script_command = require('./components/zsh-script-command.cjs');
|
|
13
|
-
const require_components_zsh_shared = require('./components/zsh-shared.cjs');
|
|
14
|
-
require('./components/index.cjs');
|
|
15
|
-
const require_types_shell_type = require('./types/shell-type.cjs');
|
|
16
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
17
|
-
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
18
|
-
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
19
|
-
let _stryke_path_join = require("@stryke/path/join");
|
|
20
|
-
|
|
21
|
-
//#region src/index.tsx
|
|
22
|
-
/**
|
|
23
|
-
* The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.
|
|
24
|
-
*/
|
|
25
|
-
const plugin = (options = {}) => {
|
|
26
|
-
return [{
|
|
27
|
-
name: "shell-shock:completions",
|
|
28
|
-
config() {
|
|
29
|
-
this.debug("Providing default configuration for the Shell Shock `completions` plugin.");
|
|
30
|
-
return { completions: {
|
|
31
|
-
shells: [...require_types_shell_type.SHELL_TYPES],
|
|
32
|
-
...options
|
|
33
|
-
} };
|
|
34
|
-
},
|
|
35
|
-
configResolved() {
|
|
36
|
-
this.debug("Adding the CLI completion commands to the application context.");
|
|
37
|
-
this.inputs ??= [];
|
|
38
|
-
if (this.inputs.some((input) => input.id === "completions")) this.info("The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
39
|
-
else this.inputs.push({
|
|
40
|
-
id: "completions",
|
|
41
|
-
name: "completions",
|
|
42
|
-
alias: ["completion"],
|
|
43
|
-
path: "completions",
|
|
44
|
-
segments: ["completions"],
|
|
45
|
-
title: "Completions",
|
|
46
|
-
icon: "🖵",
|
|
47
|
-
tags: ["Utility"],
|
|
48
|
-
description: `Commands for generating shell completion scripts for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)}.`,
|
|
49
|
-
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "index.ts") },
|
|
50
|
-
isVirtual: true,
|
|
51
|
-
source: "completions-plugin"
|
|
52
|
-
});
|
|
53
|
-
if (this.config.completions.shells.includes("bash")) if (this.inputs.some((input) => input.id === "completions-bash")) this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
54
|
-
else {
|
|
55
|
-
this.inputs.push({
|
|
56
|
-
id: "completions-bash",
|
|
57
|
-
name: "bash",
|
|
58
|
-
description: `Commands to setup bash completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
59
|
-
alias: [],
|
|
60
|
-
path: "completions/bash",
|
|
61
|
-
segments: ["completions", "bash"],
|
|
62
|
-
title: "Completions - Bash",
|
|
63
|
-
tags: ["Utility"],
|
|
64
|
-
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "index.ts") },
|
|
65
|
-
isVirtual: true,
|
|
66
|
-
source: "completions-plugin"
|
|
67
|
-
});
|
|
68
|
-
this.inputs.push({
|
|
69
|
-
id: "completions-bash-script",
|
|
70
|
-
name: "script",
|
|
71
|
-
description: `Generate a bash completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
72
|
-
alias: [],
|
|
73
|
-
path: "completions/bash/script",
|
|
74
|
-
segments: [
|
|
75
|
-
"completions",
|
|
76
|
-
"bash",
|
|
77
|
-
"script"
|
|
78
|
-
],
|
|
79
|
-
title: "Completions - Bash Script",
|
|
80
|
-
tags: ["Utility"],
|
|
81
|
-
entry: {
|
|
82
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "script", "index.ts"),
|
|
83
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "script", "command.ts") }
|
|
84
|
-
},
|
|
85
|
-
isVirtual: false,
|
|
86
|
-
source: "completions-plugin"
|
|
87
|
-
});
|
|
88
|
-
this.inputs.push({
|
|
89
|
-
id: "completions-bash-config",
|
|
90
|
-
name: "config",
|
|
91
|
-
description: `Update the current system's bash shell configuration to include completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
92
|
-
alias: [],
|
|
93
|
-
path: "completions/bash/config",
|
|
94
|
-
segments: [
|
|
95
|
-
"completions",
|
|
96
|
-
"bash",
|
|
97
|
-
"config"
|
|
98
|
-
],
|
|
99
|
-
title: "Completions - Bash Configuration",
|
|
100
|
-
tags: ["Utility"],
|
|
101
|
-
entry: {
|
|
102
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "config", "index.ts"),
|
|
103
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "config", "command.ts") }
|
|
104
|
-
},
|
|
105
|
-
isVirtual: false,
|
|
106
|
-
source: "completions-plugin"
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
if (this.config.completions.shells.includes("zsh")) if (this.inputs.some((input) => input.id === "completions-zsh")) this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
110
|
-
else {
|
|
111
|
-
this.inputs.push({
|
|
112
|
-
id: "completions-zsh",
|
|
113
|
-
name: "zsh",
|
|
114
|
-
description: `Commands to setup Zsh completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
115
|
-
alias: [],
|
|
116
|
-
path: "completions/zsh",
|
|
117
|
-
segments: ["completions", "zsh"],
|
|
118
|
-
title: "Completions - Zsh",
|
|
119
|
-
tags: ["Utility"],
|
|
120
|
-
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "index.ts") },
|
|
121
|
-
isVirtual: true,
|
|
122
|
-
source: "completions-plugin"
|
|
123
|
-
});
|
|
124
|
-
this.inputs.push({
|
|
125
|
-
id: "completions-zsh-script",
|
|
126
|
-
name: "script",
|
|
127
|
-
description: `Generate a Zsh completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
128
|
-
alias: [],
|
|
129
|
-
path: "completions/zsh/script",
|
|
130
|
-
segments: [
|
|
131
|
-
"completions",
|
|
132
|
-
"zsh",
|
|
133
|
-
"script"
|
|
134
|
-
],
|
|
135
|
-
title: "Completions - Zsh Script",
|
|
136
|
-
tags: ["Utility"],
|
|
137
|
-
entry: {
|
|
138
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "script", "index.ts"),
|
|
139
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "script", "command.ts") }
|
|
140
|
-
},
|
|
141
|
-
isVirtual: false,
|
|
142
|
-
source: "completions-plugin"
|
|
143
|
-
});
|
|
144
|
-
this.inputs.push({
|
|
145
|
-
id: "completions-zsh-config",
|
|
146
|
-
name: "config",
|
|
147
|
-
description: `Update the current system's Zsh shell configuration to include completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
148
|
-
alias: [],
|
|
149
|
-
path: "completions/zsh/config",
|
|
150
|
-
segments: [
|
|
151
|
-
"completions",
|
|
152
|
-
"zsh",
|
|
153
|
-
"config"
|
|
154
|
-
],
|
|
155
|
-
title: "Completions - Zsh Configuration",
|
|
156
|
-
tags: ["Utility"],
|
|
157
|
-
entry: {
|
|
158
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "config", "index.ts"),
|
|
159
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "config", "command.ts") }
|
|
160
|
-
},
|
|
161
|
-
isVirtual: false,
|
|
162
|
-
source: "completions-plugin"
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
if (this.config.completions.shells.includes("powershell")) if (this.inputs.some((input) => input.id === "completions-powershell")) this.info("The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
166
|
-
else {
|
|
167
|
-
this.inputs.push({
|
|
168
|
-
id: "completions-powershell",
|
|
169
|
-
name: "powershell",
|
|
170
|
-
description: `Commands to setup PowerShell completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
171
|
-
alias: [],
|
|
172
|
-
path: "completions/powershell",
|
|
173
|
-
segments: ["completions", "powershell"],
|
|
174
|
-
title: "Completions - PowerShell",
|
|
175
|
-
tags: ["Utility"],
|
|
176
|
-
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "index.ts") },
|
|
177
|
-
isVirtual: true,
|
|
178
|
-
source: "completions-plugin"
|
|
179
|
-
});
|
|
180
|
-
this.inputs.push({
|
|
181
|
-
id: "completions-powershell-script",
|
|
182
|
-
name: "script",
|
|
183
|
-
description: `Generate a PowerShell completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
184
|
-
alias: [],
|
|
185
|
-
path: "completions/powershell/script",
|
|
186
|
-
segments: [
|
|
187
|
-
"completions",
|
|
188
|
-
"powershell",
|
|
189
|
-
"script"
|
|
190
|
-
],
|
|
191
|
-
title: "Completions - PowerShell Script",
|
|
192
|
-
tags: ["Utility"],
|
|
193
|
-
entry: {
|
|
194
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "script", "index.ts"),
|
|
195
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "script", "command.ts") }
|
|
196
|
-
},
|
|
197
|
-
isVirtual: false,
|
|
198
|
-
source: "completions-plugin"
|
|
199
|
-
});
|
|
200
|
-
this.inputs.push({
|
|
201
|
-
id: "completions-powershell-config",
|
|
202
|
-
name: "config",
|
|
203
|
-
description: `Update the current system's PowerShell configuration to include completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
204
|
-
alias: [],
|
|
205
|
-
path: "completions/powershell/config",
|
|
206
|
-
segments: [
|
|
207
|
-
"completions",
|
|
208
|
-
"powershell",
|
|
209
|
-
"config"
|
|
210
|
-
],
|
|
211
|
-
title: "Completions - PowerShell Configuration",
|
|
212
|
-
tags: ["Utility"],
|
|
213
|
-
entry: {
|
|
214
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "config", "index.ts"),
|
|
215
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "config", "command.ts") }
|
|
216
|
-
},
|
|
217
|
-
isVirtual: false,
|
|
218
|
-
source: "completions-plugin"
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
if (this.config.completions.shells.includes("fish")) if (this.inputs.some((input) => input.id === "completions-fish")) this.info("The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
222
|
-
else {
|
|
223
|
-
this.inputs.push({
|
|
224
|
-
id: "completions-fish",
|
|
225
|
-
name: "fish",
|
|
226
|
-
description: `Commands to setup Fish completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
227
|
-
alias: [],
|
|
228
|
-
path: "completions/fish",
|
|
229
|
-
segments: ["completions", "fish"],
|
|
230
|
-
title: "Completions - Fish",
|
|
231
|
-
tags: ["Utility"],
|
|
232
|
-
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "index.ts") },
|
|
233
|
-
isVirtual: true,
|
|
234
|
-
source: "completions-plugin"
|
|
235
|
-
});
|
|
236
|
-
this.inputs.push({
|
|
237
|
-
id: "completions-fish-script",
|
|
238
|
-
name: "script",
|
|
239
|
-
description: `Generate a Fish completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
240
|
-
alias: [],
|
|
241
|
-
path: "completions/fish/script",
|
|
242
|
-
segments: [
|
|
243
|
-
"completions",
|
|
244
|
-
"fish",
|
|
245
|
-
"script"
|
|
246
|
-
],
|
|
247
|
-
title: "Completions - Fish Script",
|
|
248
|
-
tags: ["Utility"],
|
|
249
|
-
entry: {
|
|
250
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "script", "index.ts"),
|
|
251
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "script", "command.ts") }
|
|
252
|
-
},
|
|
253
|
-
isVirtual: false,
|
|
254
|
-
source: "completions-plugin"
|
|
255
|
-
});
|
|
256
|
-
this.inputs.push({
|
|
257
|
-
id: "completions-fish-config",
|
|
258
|
-
name: "config",
|
|
259
|
-
description: `Update the current system's Fish shell configuration to include completions for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
260
|
-
alias: [],
|
|
261
|
-
path: "completions/fish/config",
|
|
262
|
-
segments: [
|
|
263
|
-
"completions",
|
|
264
|
-
"fish",
|
|
265
|
-
"config"
|
|
266
|
-
],
|
|
267
|
-
title: "Completions - Fish Configuration",
|
|
268
|
-
tags: ["Utility"],
|
|
269
|
-
entry: {
|
|
270
|
-
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "config", "index.ts"),
|
|
271
|
-
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "config", "command.ts") }
|
|
272
|
-
},
|
|
273
|
-
isVirtual: false,
|
|
274
|
-
source: "completions-plugin"
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
prepare: {
|
|
279
|
-
order: "pre",
|
|
280
|
-
async handler() {
|
|
281
|
-
this.debug("Rendering command handling modules for the Shell Shock `completions` plugin.");
|
|
282
|
-
return (0, _powerlines_plugin_alloy_render.render)(this, [
|
|
283
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bash_shared.BashCompletionsShared, {}),
|
|
284
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bash_script_command.BashScriptCompletionsCommand, {}),
|
|
285
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bash_config_command.BashConfigCompletionsCommand, {}),
|
|
286
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_shared.ZshCompletionsShared, {}),
|
|
287
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_script_command.ZshScriptCompletionsCommand, {}),
|
|
288
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_config_command.ZshConfigCompletionsCommand, {}),
|
|
289
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_shared.PowerShellCompletionsShared, {}),
|
|
290
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_script_command.PowerShellScriptCompletionsCommand, {}),
|
|
291
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_config_command.PowerShellConfigCompletionsCommand, {}),
|
|
292
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_fish_shared.FishCompletionsShared, {}),
|
|
293
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_fish_script_command.FishScriptCompletionsCommand, {}),
|
|
294
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_fish_config_command.FishConfigCompletionsCommand, {})
|
|
295
|
-
]);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}];
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
//#endregion
|
|
302
|
-
exports.default = plugin;
|
|
303
|
-
exports.plugin = plugin;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./components/bash-config-command.cjs`),t=require(`./components/bash-script-command.cjs`),n=require(`./components/bash-shared.cjs`),r=require(`./components/fish-config-command.cjs`),i=require(`./components/fish-script-command.cjs`),a=require(`./components/fish-shared.cjs`),o=require(`./components/powershell-config-command.cjs`),s=require(`./components/powershell-script-command.cjs`),c=require(`./components/powershell-shared.cjs`),l=require(`./components/zsh-config-command.cjs`),u=require(`./components/zsh-script-command.cjs`),d=require(`./components/zsh-shared.cjs`);require(`./components/index.cjs`);const f=require(`./types/shell-type.cjs`);let p=require(`@alloy-js/core/jsx-runtime`),m=require(`@powerlines/plugin-alloy/render`),h=require(`@shell-shock/core/plugin-utils`),g=require(`@stryke/path/join`);const _=(_={})=>[{name:`shell-shock:completions`,config(){return this.debug("Providing default configuration for the Shell Shock `completions` plugin."),{completions:{shells:[...f.SHELL_TYPES],..._}}},configResolved(){this.debug(`Adding the CLI completion commands to the application context.`),this.inputs??=[],this.inputs.some(e=>e.id===`completions`)?this.info("The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command."):this.inputs.push({id:`completions`,name:`completions`,alias:[`completion`],path:`completions`,segments:[`completions`],title:`Completions`,icon:`🖵`,tags:[`Utility`],description:`Commands for generating shell completion scripts for ${(0,h.getAppTitle)(this)}.`,entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`index.ts`)},isVirtual:!0,source:`completions-plugin`}),this.config.completions.shells.includes(`bash`)&&(this.inputs.some(e=>e.id===`completions-bash`)?this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command."):(this.inputs.push({id:`completions-bash`,name:`bash`,description:`Commands to setup bash completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/bash`,segments:[`completions`,`bash`],title:`Completions - Bash`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`bash`,`index.ts`)},isVirtual:!0,source:`completions-plugin`}),this.inputs.push({id:`completions-bash-script`,name:`script`,description:`Generate a bash completion script for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/bash/script`,segments:[`completions`,`bash`,`script`],title:`Completions - Bash Script`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`bash`,`script`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`bash`,`script`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}),this.inputs.push({id:`completions-bash-config`,name:`config`,description:`Update the current system's bash shell configuration to include completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/bash/config`,segments:[`completions`,`bash`,`config`],title:`Completions - Bash Configuration`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`bash`,`config`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`bash`,`config`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}))),this.config.completions.shells.includes(`zsh`)&&(this.inputs.some(e=>e.id===`completions-zsh`)?this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command."):(this.inputs.push({id:`completions-zsh`,name:`zsh`,description:`Commands to setup Zsh completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/zsh`,segments:[`completions`,`zsh`],title:`Completions - Zsh`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`zsh`,`index.ts`)},isVirtual:!0,source:`completions-plugin`}),this.inputs.push({id:`completions-zsh-script`,name:`script`,description:`Generate a Zsh completion script for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/zsh/script`,segments:[`completions`,`zsh`,`script`],title:`Completions - Zsh Script`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`zsh`,`script`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`zsh`,`script`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}),this.inputs.push({id:`completions-zsh-config`,name:`config`,description:`Update the current system's Zsh shell configuration to include completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/zsh/config`,segments:[`completions`,`zsh`,`config`],title:`Completions - Zsh Configuration`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`zsh`,`config`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`zsh`,`config`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}))),this.config.completions.shells.includes(`powershell`)&&(this.inputs.some(e=>e.id===`completions-powershell`)?this.info("The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command."):(this.inputs.push({id:`completions-powershell`,name:`powershell`,description:`Commands to setup PowerShell completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/powershell`,segments:[`completions`,`powershell`],title:`Completions - PowerShell`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`powershell`,`index.ts`)},isVirtual:!0,source:`completions-plugin`}),this.inputs.push({id:`completions-powershell-script`,name:`script`,description:`Generate a PowerShell completion script for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/powershell/script`,segments:[`completions`,`powershell`,`script`],title:`Completions - PowerShell Script`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`powershell`,`script`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`powershell`,`script`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}),this.inputs.push({id:`completions-powershell-config`,name:`config`,description:`Update the current system's PowerShell configuration to include completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/powershell/config`,segments:[`completions`,`powershell`,`config`],title:`Completions - PowerShell Configuration`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`powershell`,`config`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`powershell`,`config`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}))),this.config.completions.shells.includes(`fish`)&&(this.inputs.some(e=>e.id===`completions-fish`)?this.info("The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command."):(this.inputs.push({id:`completions-fish`,name:`fish`,description:`Commands to setup Fish completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/fish`,segments:[`completions`,`fish`],title:`Completions - Fish`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`fish`,`index.ts`)},isVirtual:!0,source:`completions-plugin`}),this.inputs.push({id:`completions-fish-script`,name:`script`,description:`Generate a Fish completion script for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/fish/script`,segments:[`completions`,`fish`,`script`],title:`Completions - Fish Script`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`fish`,`script`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`fish`,`script`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`}),this.inputs.push({id:`completions-fish-config`,name:`config`,description:`Update the current system's Fish shell configuration to include completions for the ${(0,h.getAppTitle)(this,!0)} command-line interface.`,alias:[],path:`completions/fish/config`,segments:[`completions`,`fish`,`config`],title:`Completions - Fish Configuration`,tags:[`Utility`],entry:{file:(0,g.joinPaths)(this.entryPath,`completions`,`fish`,`config`,`index.ts`),input:{file:(0,g.joinPaths)(this.entryPath,`completions`,`fish`,`config`,`command.ts`)}},isVirtual:!1,source:`completions-plugin`})))},prepare:{order:`pre`,async handler(){return this.debug("Rendering command handling modules for the Shell Shock `completions` plugin."),(0,m.render)(this,[(0,p.createComponent)(n.BashCompletionsShared,{}),(0,p.createComponent)(t.BashScriptCompletionsCommand,{}),(0,p.createComponent)(e.BashConfigCompletionsCommand,{}),(0,p.createComponent)(d.ZshCompletionsShared,{}),(0,p.createComponent)(u.ZshScriptCompletionsCommand,{}),(0,p.createComponent)(l.ZshConfigCompletionsCommand,{}),(0,p.createComponent)(c.PowerShellCompletionsShared,{}),(0,p.createComponent)(s.PowerShellScriptCompletionsCommand,{}),(0,p.createComponent)(o.PowerShellConfigCompletionsCommand,{}),(0,p.createComponent)(a.FishCompletionsShared,{}),(0,p.createComponent)(i.FishScriptCompletionsCommand,{}),(0,p.createComponent)(r.FishConfigCompletionsCommand,{})])}}}];exports.default=_,exports.plugin=_;
|