152 lines
3.9 KiB
Bash
Executable File
152 lines
3.9 KiB
Bash
Executable File
#compdef nirc nirc-rs
|
|
# nirc-rs zsh completion for 0.5.0
|
|
|
|
local -a subcommands protocols matrix_cmds adc_cmds revolt_cmds bitchat_cmds
|
|
|
|
subcommands=(
|
|
'connect:Connect to a server'
|
|
'disconnect:Disconnect from a protocol'
|
|
'join:Join a channel or room'
|
|
'part:Leave a channel'
|
|
'msg:Send a private message'
|
|
'me:Send an action'
|
|
'say:Send text to current window'
|
|
'notice:Send a notice'
|
|
'ctcp:Send a CTCP query'
|
|
'raw:Send a raw IRC line'
|
|
'quote:Alias for /raw'
|
|
'nick:Change nickname'
|
|
'away:Set away status'
|
|
'who:List users'
|
|
'whois:User information'
|
|
'names:List channel users'
|
|
'topic:View or set topic'
|
|
'invite:Invite user to channel'
|
|
'list:List channels'
|
|
'kick:Kick user from channel'
|
|
'op:Give operator status'
|
|
'deop:Remove operator status'
|
|
'mode:Set channel or user mode'
|
|
'oper:Become IRC operator'
|
|
'kill:Force-disconnect a user'
|
|
'kline:Set a K-line ban'
|
|
'unkline:Remove a K-line ban'
|
|
'wallops:Send message to operators'
|
|
'ignore:Toggle ignore on a user'
|
|
'unblock:Remove user from ignore list'
|
|
'sendfile:Send a file'
|
|
'acceptfile:Accept incoming file transfer'
|
|
'listtransfers:Toggle transfer panel'
|
|
'win:Switch or list windows'
|
|
'jump:Jump to window'
|
|
'jumpback:Return to previous window'
|
|
'close:Close window'
|
|
'open:Open query window'
|
|
'winlist:Toggle winlist'
|
|
'set:Set a user variable'
|
|
'get:Print a user variable'
|
|
'alias:Define an alias'
|
|
'unalias:Remove an alias'
|
|
'bind:Bind a key to a command'
|
|
'unbind:Remove a key binding'
|
|
'eval:Expand and re-evaluate text'
|
|
'source:Execute a file of commands'
|
|
'echo:Display text'
|
|
'clear:Clear current tab'
|
|
'clearall:Clear all tabs'
|
|
'save:Save configuration'
|
|
'help:Show command reference'
|
|
'quit:Disconnect and exit'
|
|
'newconn:New connection'
|
|
'server:Switch server'
|
|
'matrix:Matrix protocol commands'
|
|
'adc:ADC/DC++ protocol commands'
|
|
'dc:Alias for /adc'
|
|
'revolt:Revolt protocol commands'
|
|
'stoat:Alias for /revolt'
|
|
'bitchat:BitChat P2P commands'
|
|
'p2p:Alias for /bitchat'
|
|
)
|
|
|
|
protocols=(
|
|
'irc:IRC protocol'
|
|
'matrix:Matrix protocol'
|
|
'adc:ADC/DC++ protocol'
|
|
'dc:Alias for adc'
|
|
'bitchat:BitChat P2P'
|
|
'revolt:Revolt protocol'
|
|
'stoat:Alias for revolt'
|
|
)
|
|
|
|
matrix_cmds=(
|
|
'login:Password login'
|
|
'logout:Log out'
|
|
'create:Create a room'
|
|
'invite:Invite user to room'
|
|
'members:List room members'
|
|
'whoami:Show user info'
|
|
'devices:List devices'
|
|
'verify:Start SAS verification'
|
|
'verify-confirm:Confirm SAS verification'
|
|
'verify-cancel:Cancel SAS verification'
|
|
'react:React to message'
|
|
'reply:Reply to event'
|
|
'backfill:Backfill messages'
|
|
)
|
|
|
|
adc_cmds=(
|
|
'search:Search hub files'
|
|
'users:List hub users'
|
|
'broadcast:Broadcast to hub'
|
|
'get:Download file'
|
|
'download:Download file'
|
|
'dl:Download file'
|
|
)
|
|
|
|
revolt_cmds=(
|
|
'join:Join server'
|
|
'leave:Leave server'
|
|
'members:List members'
|
|
)
|
|
|
|
bitchat_cmds=(
|
|
'peers:List P2P peers'
|
|
'dm:Send direct message'
|
|
'msg:Send direct message'
|
|
'send:Send file'
|
|
'sendfile:Send file'
|
|
'list:List P2P peers'
|
|
)
|
|
|
|
_nirc_subcommand() {
|
|
local -a opts
|
|
case $words[2] in
|
|
connect)
|
|
_describe 'protocol' protocols
|
|
;;
|
|
matrix)
|
|
_describe 'matrix-command' matrix_cmds
|
|
;;
|
|
adc|dc)
|
|
_describe 'adc-command' adc_cmds
|
|
;;
|
|
revolt|stoat)
|
|
_describe 'revolt-command' revolt_cmds
|
|
;;
|
|
bitchat|p2p)
|
|
_describe 'bitchat-command' bitchat_cmds
|
|
;;
|
|
sendfile|source|acceptfile)
|
|
_files
|
|
;;
|
|
'adc get'|'adc download'|'adc dl'|'bitchat send'|'bitchat sendfile'|'p2p send')
|
|
_files
|
|
;;
|
|
esac
|
|
}
|
|
|
|
if (( CURRENT == 2 )); then
|
|
_describe 'command' subcommands
|
|
else
|
|
_nirc_subcommand
|
|
fi |