Compare commits

..

7 Commits

Author SHA1 Message Date
F.B. 76e31f1675
Merge 5359bbf0e7 into 8b97eaf521 2026-04-05 19:21:18 -04:00
Shohei YOSHIDA 8b97eaf521
Merge pull request #1255 from zsh-users/add_pwsh
Add PowerShell completion for macOS and Linux
2026-04-04 10:06:45 +09:00
Shohei YOSHIDA 959c0fa665
Merge pull request #1256 from zsh-users/add-v8-options
Add valid v8 options
2026-04-02 15:39:11 +09:00
Shohei YOSHIDA 3bf359f3cb
Merge pull request #1253 from zsh-users/elixir_completions
Add elixir(elixir, elixirc, iex) completions
2026-04-02 15:38:39 +09:00
Shohei YOSHIDA 673251514c
Add valid v8 options 2026-04-02 12:01:35 +09:00
Shohei YOSHIDA 7fa1a78810
Add PowerShell completion for macOS and Linux 2026-03-31 10:34:56 +09:00
Shohei YOSHIDA dbad2d3a85
Add elixir completions 2026-03-29 16:44:33 +09:00
3 changed files with 203 additions and 1 deletions

99
src/_elixir Normal file
View File

@ -0,0 +1,99 @@
#compdef elixir elixirc iex
# ------------------------------------------------------------------------------
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for elixir 1.19.5 (https://elixir-lang.org/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
if [[ $service == "iex" ]]; then
_arguments \
'--dbg[Set the backend for Kernel.dbg/2]:backend:(pry)' \
'--dot-iex[Evaluate file, line by line to set up IEx environment]:file:_files' \
'--remsh[Connect to a node using a remote shell]:name' \
'*::file_or_data:_files -g "*.exs"'
else
local -a elixir_options=(
\*{-e,--eval}'[Evaluate the given command]:command'
'(- *)'{-h,--help}'[Print help message]'
'*-r[Require the given files or patterns]:file_or_pattern:_files'
'-S[Find and execute the given script in $PATH]:file:_files'
'*-pr[Require the given files or patterns in parallel]:file_or_pattern:_files'
'*-pa[Prepend the given path to Erlang code path]:path:_files -/'
'*-pz[Append the given path to Erlang code path]:path:_files -/'
'(- *)'{-v,--version}'[Print Erlang/OTP and Elixir versions]'
'(--color --no-color)--color[Enable ANSI coloring]'
'(--color --no-color)--no-color[Disable ANSI coloring]'
'*--erl[Switch to be passed down to Erlang]:switch'
'--logger-otp-reports[Enable or disable OTP reporting]:bool:(true false)'
'--logger-sasl-reports[Enable or disable SASL reporting]:bool:(true false)'
'--no-halt[Do not halt the Erlang VM after execution]'
'(- *)--short-version[Print Elixir version]'
'--cookie[Set a cookie for this distributed node]:cookie'
'--hidden[Make a hidden node]'
'--name[Make and assign a name to the distributed node]:name'
'*--rpc-eval[Evaluate the given command on the given remote node]:node_command'
'--sname[Make and assign a short name to the distributed node]'
'--boot[Use the given FILE.boot to start the system]:file:_files'
'*--boot-var[Make $VAR available as VALUE to FILE.boot]:var_value'
'*--erl-config[Load configuration in FILE.config written in Erlang]:file:_files'
'--pipe-to[Start the Erlang VM as a named PIPEDIR and LOGDIR]:pipe_and_log:_files -/'
'--vm-wargs[Pass the contents in file as arguments to the VM]:file:_files'
)
case $service in
(elixir)
_arguments $elixir_options[@]
;;
(elixirc)
_arguments \
$elixir_options[@] \
'-o[The directory to output compiled files]:dir:_files -/' \
'(- *)'{-v,--version}'[Print Elixir version and exit]' \
'--ignore-module-conflict[Do not emit warnings if a module was previously defined]' \
'--no-debug-info[Do not attach debug info to compiled modules]' \
'--no-docs[Do not attach documentation to compiled modules]' \
'--profile[Profile to compile modules]:type:(time)' \
'--verbose[Print compilation status]' \
'--warnings-as-errors[Treat warnings as errors and return non-zero exit status]' \
'*::file:_files -g "*.ex"'
;;
esac
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View File

@ -28,7 +28,7 @@
# Description
# -----------
#
# Completion script for Node.js v25.8.0 (https://nodejs.org)
# Completion script for Node.js v25.9.0 (https://nodejs.org)
#
# ------------------------------------------------------------------------------
# Authors
@ -70,6 +70,23 @@ _node_scripts() {
}
_node() {
# See https://github.com/nodejs/node/blob/main/doc/api/cli.md
# Note some allowed v8 options are listed in 'node --help' but others are not
local -a v8_options=(
'--max-heap-size=[max size of the heap in Mbytes]:size'
'--max-old-space-size=[max size of the old space in Mbytes]:size'
'--max-semi-space-size=[max size of a semi-space in Mbytes]:size'
'--stack-trace-limit=[number of stack frames to capture]:limit'
)
if [[ $OSTYPE == linux* ]]; then
v8_options+=(
'--perf-basic-prof-only-functions[only report function code ranges to perf]'
'--perf-basic-prof[enable basic support for perf profiler]'
'--perf-prof-unwinding-info[enable unwinding info for perf linux profiler]'
'--perf-prof[enable annotate support for perf profiler]'
)
fi
local ret=1
_arguments \
@ -252,6 +269,7 @@ _node() {
"--watch-path=[path to watch]: :_node_files" \
'--watch-preserve-output[preserve outputs on watch mode restart]' \
'--zero-fill-buffers[automatically zero-fill all newly allocated Buffer and SlowBuffer instances]' \
$v8_options[@] \
'(- 1 *)'{-h,--help}'[print node command line options]' \
'(- 1 *)'{-v,--version}'[print Node.js version]' \
'*: :_node_args' && ret=0

85
src/_pwsh Normal file
View File

@ -0,0 +1,85 @@
#compdef pwsh
# ------------------------------------------------------------------------------
# Copyright (c) 2026 Github zsh-users - https://github.com/zsh-users
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for PowerShell 7.6.0 (https://github.com/PowerShell/PowerShell)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_pwsh_execution_policies() {
local -a policies=(
"AllSigned:Require that all scripts and config files are signed by a trusted publisher"
"Bypass:Nothing is blocked and there are no warnings or prompts"
"Default:Sets the default execution policy"
"RemoteSigned:Require that all scripts and config files downloaded from the Internet are signed by a trusted publisher"
"Restricted:Doesn't load configuration files or run scripts"
"Undefined:No execution policy is set for the scope"
"Unrestricted:Loads all configuration files and runs all scripts"
)
_describe -t policy policies policies
}
_arguments \
'(- *)'{-Help,-?}'[Display help for pwsh]' \
'(-f -File)'{-f,-File}'[Specify file name to execute, "-" means reading from standard input]:file:_files' \
'(-c -Command)'{-c,-Command}'[Execute the specified command, "-" means reading from standard input]:command' \
'(-cwa -CommandWithArgs)'{-cwa,-CommandWithArgs}'[Execute PowerShell command with arguments]:command_and_args' \
'(-config -ConfigurationName)'{-config,-ConfigurationName}'[Specify a configuration endpoint in which PowerShell is run]:config' \
'-ConfigurationFile[Specify a session configuration file path]:path:_files -g "*.pssc"' \
'-CustomPipeName[Specify the name to use for an additional IPC server]:pipe_name' \
'(-e -ec -EncodedCommand)'{-e,-ec,-EncodedCommand}'[Accept a Base64-encoded string version of a command]:encoded_command' \
'(-ex -ep -ExecutionPolicy)'{-ex,-ep,-ExecutionPolicy}'[Set the default execution policy for the current session]:policy:_pwsh_execution_policies' \
'(-inp -if -InputFormat)'{-inp,-if,-InputFormat}'[Describe the format of data sent to PowerShell]:format:(Text XML)' \
'(-i -Interactive -noni -NonInteractive)'{-i,-Interactive}'[Present an interactive prompt to the user]' \
'(-l -Login)'{-l,-Login}'[Start PowerShell as a login shell]' \
'(-MTA -STA)-MTA[Start PowerShell using a multi-threaded apartment, available only on Windows]' \
'(-noe -NoExit)'{-noe,-NoExit}'[Do not exit after running startup Completion]' \
'(-nol -NoLogo)'{-nol,-NoLogo}'[Hide the banner text at startup of interactive sessions]' \
'(-i -Interactive -noni -NonInteractive)'{-noni,-NonInteractive}'[Create sessions that should not require user input]' \
'(-nop -NoProfile)'{-nop,-NoProfile}'[Do not load the PowerShell profiles]' \
'-NoProfileLoadTime[Hide the PowerShell profile load time text shown at startup when it takes more than 500msecs]' \
'(-o -of -OutputFormat)'{-o,-of,-OutputFormat}'[Determine how output from PowerShell is formatted]:format:(Text XML)' \
'(-settings -SettingsFile)'{-settings,-SettingsFile}'[Override the system-wide settings file for the session]:file:_files -g "*.json"' \
'(-sshs -SSHServerMode)'{-sshs,-SSHServerMode}'[Used in sshd_config for running PowerShell as an SSH subsystem]' \
'(-MTA -STA)-STA[Start PowerShell using a single-threaded apartment, only available on Windows]' \
'(- *)'{-v,-Version}'[Display the version of PowerShell]' \
'(-w -WindowStyle)'{-w,-WindowStyle}'[Set the window style for the session]:style:(Normal Minimized Maximized Hidden)' \
'(-wd -WorkingDirectory)'{-wd,-WorkingDirectory}'[Set the initial working directory]:dir:_files -/' \
'*:: :_files'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et