Compare commits

...

4 Commits

Author SHA1 Message Date
Alexander F. Rødseth 35f08c358a
Merge 4f793a0031 into 584dfd5d30 2025-11-27 14:02:19 +09:00
Shohei YOSHIDA 584dfd5d30
Merge pull request #1176 from zsh-users/add-sslscan
Add sslscan completion
2025-11-25 12:08:57 +09:00
Shohei YOSHIDA c0200438ed
Add sslscan completion 2025-11-24 23:15:25 +09:00
Alexander F. Rødseth 4f793a0031 Add completions for sox 2024-09-15 16:09:31 +02:00
5 changed files with 169 additions and 177 deletions

185
src/_play
View File

@ -1,190 +1,21 @@
#compdef play #compdef play
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
#
# Description # Description
# ----------- # -----------
# Completion script for the play command (from SoX)
# (http://sox.sourceforge.net/)
# #
# Completion script for Play! framework 1.2.2 (https://www.playframework.com/).
#
# ------------------------------------------------------------------------------
# Authors # Authors
# ------- # -------
# #
# * Julien Nicoulaud <julien.nicoulaud@gmail.com> # * Alexander F. Rødseth <xyproto@archlinux.org>
# * Mario Fernandez (https://github.com/sirech)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_play() { _arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '(-D --no-dither)'{-D,--no-dither}"[don't dither automatically]" '(-r --rate=)'{-r,--rate=}'[set sample rate]:rate' '(-c --channels=)'{-c,--channels=}'[specify the number of channels]:channels' '(-t --type=)'{-t,--type=}'[specify file type]:file type:_files' '(-p --sox-pipe)'{-p,--sox-pipe}'[use SoX pipe]' '(-q --no-show-progress)'{-q,--no-show-progress}'[run in quiet mode]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1 return ret
_arguments -C \
'1: :_play_cmds' \
'*::arg:->args' \
&& ret=0
case $state in
(args)
curcontext="${curcontext%:*:*}:play-cmd-$words[1]:"
case $line[1] in
(build-module|list-modules|lm|check|id)
_message 'no more arguments' && ret=0
;;
(dependencies|deps)
_arguments \
'1:: :_play_apps' \
'(--debug)--debug[Debug mode (even more information logged than in verbose mode)]' \
'(--jpda)--jpda[Listen for JPDA connection. The process will be suspended until a client is plugged to the JPDA port.]' \
'(--sync)--sync[Keep lib/ and modules/ directory synced. Delete unknown dependencies.]' \
'(--verbose)--verbose[Verbose Mode]' \
&& ret=0
;;
(clean|javadoc|jd|out|pid|secret|stop)
_arguments '1:: :_play_apps' && ret=0
;;
(help)
_arguments '1: :_play_cmds -F "(cp deps ec idea jd st lm nb nm help antify evolutions evolutions:apply evolutions:markApplied evolutions:resolve)"' && ret=0
;;
(status|st)
_arguments \
'1:: :_play_apps' \
'(--url)--url[If you want to monitor an application running on a remote server, specify the application URL using this option]:URL:_urls' \
'(--secret)--secret[You can provide your own secret key using this option]:Secret key' \
&& ret=0
;;
(new)
_arguments \
'1: :_play_apps' \
'(--with)--with[Automatically enable this set of module for the newly created application]:Modules list:_play_modules_list' \
&& ret=0
;;
(install)
_arguments '1:Play! module:_play_modules_dash_versions' && ret=0
;;
(new-module)
_arguments '1:Module directory:_files -/' && ret=0
;;
(test|precompile|run|start|war|auto-test|classpath|cp|eclipsify|ec|idealize|idea|modules|netbeansify|nb)
local cmd_args; cmd_args=(
'1:: :_play_apps'
'(--deps)--deps[Resolve and install dependencies before running the command]'
)
case $line[1] in
(precompile|run|start|restart|war)
local app_dir="$line[2]"
[[ -d "$app_dir" ]] || app_dir=.
[[ -f "$app_dir/conf/application.conf" ]] && cmd_args+=('--'${(u)${(M)$(<$app_dir/conf/application.conf):#%*}%%.*}'[Use this ID to run the application (override the default framework ID)]')
;|
(test|run)
cmd_args+=('(-f)-f[Disable the JPDA port checking and force the jpda.port value]')
;|
(war)
cmd_args+=(
'(-o --output)'{-o,--output}'[The path where the WAR directory will be created. The contents of this directory will first be deleted]:output directory:_files -/'
'(--zip)--zip[By default, the script creates an exploded WAR. If you want a zipped archive, specify the --zip option]'
'(--exclude)--exclude[Excludes a list of colon separated directories]:excluded directories list:_play_colon_dirs_list'
)
;|
(test|run|start|restart|war)
cmd_args+=('*:Java option')
;;
esac
_arguments "$cmd_args[@]" && ret=0
;;
*)
_call_function ret _play_cmd_$words[1] && ret=0
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
}
# FIXME Completes only core commands, some modules add commands too (eg Maven). Where do we get them ?
# FIXME Parse 'play help' and 'play help <command>' (for aliases) instead of hard-coding.
(( $+functions[_play_cmds] )) ||
_play_cmds() {
local commands; commands=(
'antify:Create a build.xml file for this project'
'auto-test:Automatically run all application tests'
'build-module:Build and package a module'
'check:Check for a release newer than the current one'
{classpath,cp}':Display the computed classpath'
'clean:Delete temporary files (including the bytecode cache)'
{dependencies,deps}':Resolve and retrieve project dependencies'
{eclipsify,ec}':Create all Eclipse configuration files'
'evolutions:Run the evolution check'
'evolutions\:apply:Automatically apply pending evolutions'
'evolutions\:mark:AppliedMark pending evolutions as manually applied'
'evolutions\:resolve:Resolve partially applied evolution'
'help:Display help on a specific command'
'id:Define the framework ID'
{idealize,idea}':Create all IntelliJ Idea configuration files'
'install:Install a module'
{javadoc,jd}':Generate your application Javadoc'
{list-modules,lm}':List modules available from the central modules repository'
'modules:Display the computed modules list'
{netbeansify,nb}':Create all NetBeans configuration files'
'new:Create a new application'
{new-module,nm}':Create a module'
'out:Follow logs/system.out file'
'pid:Show the PID of the running application'
'precompile:Precompile all Java sources and templates to speed up application start-up'
'restart:Restart the running application'
'run:Run the application in the current shell'
'secret:Generate a new secret key'
'start:Start the application in the background'
{status,st}':Display the running application status'
'stop:Stop the running application'
'test:Run the application in test mode in the current shell'
'war:Export the application as a standalone WAR archive'
)
_describe -t commands 'Play! command' commands "$@"
}
(( $+functions[_play_apps] )) ||
_play_apps() {
_wanted application expl 'Play! application directory' _files -/
}
(( $+functions[_play_modules] )) ||
_play_modules() {
local modules; modules=(${(ps:,:)${${${(S)${(f)$(_call_program modules $service list-modules)}//\]*\[/,}%%\]*}##*\[}})
_describe -t modules 'Play! module' modules "$@"
}
(( $+functions[_play_modules_dash_versions] )) ||
_play_modules_dash_versions() {
local ret=1
if compset -P '*-'; then
local versions; versions=(${(ps:,:)${${${${${(f)$(_call_program versions $service list-modules)}##*${IPREFIX%-}\]}#*Versions:}%%"~"*}//[[:space:]]/}})
_describe -t module-versions "${IPREFIX%-} module versions" versions && ret=0
else
_wanted modules expl 'Play! module' _play_modules -qS- && ret=0
fi
}
(( $+functions[_play_modules_list] )) ||
_play_modules_list() {
compset -P '*,'; compset -S ',*'
_wanted module-list expl 'Play! modules list' _play_modules -qS,
}
(( $+functions[_play_colon_dirs_list] )) ||
_play_colon_dirs_list() {
compset -P '*:'; compset -S ':*'
_wanted directories-list expl 'Directories list' _files -/ -qS:
}
_play "$@"
# 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

21
src/_rec Normal file
View File

@ -0,0 +1,21 @@
#compdef rec
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the rec command (from SoX)
# (http://sox.sourceforge.net/)
#
# Authors
# -------
#
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '(-D --no-dither)'{-D,--no-dither}"[don't dither automatically]" '(-r --rate=)'{-r,--rate=}'[set sample rate]:rate' '(-c --channels=)'{-c,--channels=}'[specify the number of channels]:channels' '(-t --type=)'{-t,--type=}'[specify file type]:file type:_files' '(-p --sox-pipe)'{-p,--sox-pipe}'[use SoX pipe]' '(-q --no-show-progress)'{-q,--no-show-progress}'[run in quiet mode]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
return ret

21
src/_sox Normal file
View File

@ -0,0 +1,21 @@
#compdef sox
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the sox command (from SoX)
# (http://sox.sourceforge.net/)
#
# Authors
# -------
#
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '(-D --no-dither)'{-D,--no-dither}"[don't dither automatically]" '(-G --guard)'{-G,--guard}'[use temporary files to guard against clipping]' '(-m --combine=)'{-m,--combine=}'[combine input files]:method:(mix merge concatenate)' '(-t --type=)'{-t,--type=}'[specify file type]:file type:_files' '(-r --rate=)'{-r,--rate=}'[set sample rate]:rate' '(-c --channels=)'{-c,--channels=}'[specify the number of channels]:channels' '(-b --bits=)'{-b,--bits=}'[set encoded sample size in bits]:bits' '(-e --encoding=)'{-e,--encoding=}'[set encoding]:encoding:(signed-integer unsigned-integer floating-point mu-law a-law)' '(-p --sox-pipe)'{-p,--sox-pipe}'[use SoX pipe]' '(-q --no-show-progress)'{-q,--no-show-progress}'[run in quiet mode]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
return ret

21
src/_soxi Normal file
View File

@ -0,0 +1,21 @@
#compdef soxi
# ------------------------------------------------------------------------------
#
# Description
# -----------
# Completion script for the soxi command (from SoX)
# (http://sox.sourceforge.net/)
#
# Authors
# -------
#
# * Alexander F. Rødseth <xyproto@archlinux.org>
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line
local -i ret=1
_arguments -s -S -C '(-h --help)'{-h,--help}'[display help text]' '(-V --version)'{-V,--version}'[display version information]' '*:filename:_files -g "*.wav *.mp3 *.flac *.ogg *.aiff"' && ret=0
return ret

98
src/_sslscan Normal file
View File

@ -0,0 +1,98 @@
#compdef sslscan
# ------------------------------------------------------------------------------
# Copyright (c) 2025 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# 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 sslscan 2.2.0. (https://github.com/rbsec/sslscan)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Shohei YOSHIDA (https://github.com/syohex)
#
# ------------------------------------------------------------------------------
_arguments \
'--targets=[a file containing a list of hosts to check]:file:_files' \
'--sni-name=[hostname for SNI]:name' \
'(-4 --ipv4 -6 --ipv6)'{-4,--ipv4}'[only use IPv4]' \
'(-4 --ipv4 -6 --ipv6)'{-6,--ipv6}'[only use IPv6]' \
'--show-certificate[show full certificate information]' \
'--show-certificates[show chain full certificates information]' \
'--show-client-cas[show trusted CAs for TLS client auth]' \
'--no-check-certificate[do not warn about weak certificate algorithm or keys]' \
'--ocsp[request OCSP response from server]' \
'--pk=[a file containing the private key or a PKCS#12 file]:file:_files' \
'--pkpass=[the password for private key or PKCS#12 file]:password' \
'--certs[a file containing PEM/ASN1 formatted client certificates]:file:_files' \
'--ssl2[only check if SSLv2 is enabled]' \
'--ssl3[only check if SSLv3 is enabled]' \
'--tls10[only check TLSv1.0 ciphers]' \
'--tls11[only check TLSv1.1 ciphers]' \
'--tls12[only check TLSv1.2 ciphers]' \
'--tls13[only check TLSv1.3 ciphers]' \
'--tlsall[only check TLS ciphers(all versions)]' \
'--show-ciphers[show supported client ciphers]' \
'--show-cipher-ids[show cipher IDs]' \
'--iana-names[use IANA/RFC cipher names rather than OpenSSL ones]' \
'--show-times[show handshake times in milliseconds]' \
'--no-cipher-details[disable EC curve names and EDH/RSA key lengths output]' \
'--no-ciphersuites[do not check for supported ciphersuites]' \
'--no-compression[do not check for TLS compression(CRIME)]' \
'--no-fallback[do not check for TLS Fallback SCSV]' \
'--no-groups[do not enumerate key exchange groups]' \
'--no-heartbleed[do not check for OpenSSL Heartbleed(CVE-2014-0160)]' \
'--no-renegotiation[do not check for TLS renegotiation]' \
'--show-sigs[enumerate signature algorithms]' \
'--starttls-ftp[STARTTLS setup for FTP]' \
'--starttls-imap[STARTTLS setup for IMAP]' \
'--starttls-irc[STARTTLS setup for IRC]' \
'--starttls-ldap[STARTTLS setup for LDAP]' \
'--starttls-mysql[STARTTLS setup for MYSQL]' \
'--starttls-pop3[STARTTLS setup for POP3]' \
'--starttls-psql[STARTTLS setup for PostgreSQL]' \
'--starttls-smtp[STARTTLS setup for SMTP]' \
'--starttls-xmpp[STARTTLS setup for XMPP]' \
'--xmpp-server[use a server-to-server XMPP handshake]' \
'--rdp[send RDP preamble before starting scan]' \
'--bugs[enable SSL implementation bug work-arounds]' \
'--no-colour[disable coloured output]' \
'--sleep=[pause between connection request(msecs)]:msecs' \
'--timeout=[set socket timeout(seconds). Default is 3s]:seconds' \
'--connect-timeout=[set connect timeout(seconds). Default is 75s]:seconds' \
'--verbose[display verbose output]' \
'--version[display the program version]' \
'--xml=[output results to an XML file. Use - for STDOUT]:file:_files' \
'(- *)--help[display the help text]' \
'*::host:_urls'
# 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