Removed completions managed by zsh-completions.
This commit is contained in:
parent
15ed7860f3
commit
3dbc808b96
|
@ -1,27 +0,0 @@
|
|||
if stat -f%m . &> /dev/null; then
|
||||
stat_cmd=(stat -f%m)
|
||||
else
|
||||
stat_cmd=(stat -L --format=%Y)
|
||||
fi
|
||||
|
||||
function _ant_does_target_list_need_generating() {
|
||||
if [[ ! -f .ant_targets ]]; then
|
||||
return 0
|
||||
else
|
||||
accurate=$($stat_cmd .ant_targets)
|
||||
changed=$($stat_cmd build.xml)
|
||||
return $(expr $accurate '>=' $changed)
|
||||
fi
|
||||
}
|
||||
|
||||
function _ant() {
|
||||
if [[ -f build.xml ]]; then
|
||||
if _ant_does_target_list_need_generating; then
|
||||
sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
|
||||
fi
|
||||
compadd `cat .ant_targets`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _ant ant
|
||||
|
1
plugins/brew/.gitignore
vendored
1
plugins/brew/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
_brew
|
|
@ -1,19 +0,0 @@
|
|||
# Complete brew.
|
||||
completion_file="${0:h}/_brew"
|
||||
if [[ ! -e "$completion_file" ]]; then
|
||||
if [[ -L "$completion_file" ]]; then
|
||||
unlink "$completion_file" 2> /dev/null
|
||||
fi
|
||||
|
||||
if (( $+commands[brew] )); then
|
||||
ln -s \
|
||||
"$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" \
|
||||
"$completion_file" \
|
||||
2> /dev/null
|
||||
fi
|
||||
fi
|
||||
unset completion_file
|
||||
|
||||
# Aliases
|
||||
alias brews='brew list -1'
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Set this to 1 if you want to cache the tasks.
|
||||
cache_task_list=1
|
||||
|
||||
# Cache filename.
|
||||
cache_file='.cake_task_cache'
|
||||
|
||||
function _cake_does_target_list_need_generating() {
|
||||
if [[ $cache_task_list -eq 0 ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ ! -f $cache_file ]]; then
|
||||
return 0
|
||||
else
|
||||
accurate=$(stat -f%m $cache_file)
|
||||
changed=$(stat -f%m Cakefile)
|
||||
return $(expr $accurate '>=' $changed)
|
||||
fi
|
||||
}
|
||||
|
||||
function _cake() {
|
||||
if [[ -f Cakefile ]]; then
|
||||
if _cake_does_target_list_need_generating; then
|
||||
cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file
|
||||
compadd `cat $cache_file`
|
||||
else
|
||||
compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _cake cake
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#compdef cap
|
||||
#autoload
|
||||
|
||||
function _cap-does-task-list-need-generating() {
|
||||
if [[ ! -f .cap_tasks~ ]]; then return 0;
|
||||
else
|
||||
accurate=$(stat -f%m .cap_tasks~)
|
||||
changed=$(stat -f%m config/deploy.rb)
|
||||
return $(expr $accurate '>=' $changed)
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -f config/deploy.rb ]]; then
|
||||
if _cap-does-task-list-need-generating; then
|
||||
echo "\nGenerating .cap_tasks~..." > /dev/stderr
|
||||
cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
|
||||
fi
|
||||
compadd $(cat .cap_tasks~)
|
||||
fi
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
#compdef knife
|
||||
|
||||
# These flags should be available everywhere according to the knife man page.
|
||||
knife_general_flags=(
|
||||
--help
|
||||
--server-url
|
||||
--key
|
||||
--config
|
||||
--editor
|
||||
--format
|
||||
--log_level
|
||||
--logfile
|
||||
--no-editor
|
||||
--user
|
||||
--print-after
|
||||
--version
|
||||
--yes
|
||||
)
|
||||
|
||||
# Knife has a very special syntax, some example calls are:
|
||||
# knife status
|
||||
# knife cookbook list
|
||||
# knife role show ROLENAME
|
||||
# knife data bag show DATABAGNAME
|
||||
# knife role show ROLENAME --attribute ATTRIBUTENAME
|
||||
# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
|
||||
|
||||
# The -Q switch in compadd allows for completion of things like "data bag" without
|
||||
# having to go through two rounds of completion and avoids ZSH inserting a '\' for
|
||||
# escaping spaces.
|
||||
function _knife() {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
cloudproviders=(bluebox ec2 rackspace slicehost terremark)
|
||||
_arguments \
|
||||
'1: :->knifecmd'\
|
||||
'2: :->knifesubcmd'\
|
||||
'3: :->knifesubcmd2' \
|
||||
'4: :->knifesubcmd3' \
|
||||
'5: :->knifesubcmd4' \
|
||||
'6: :->knifesubcmd5'
|
||||
|
||||
case $state in
|
||||
(knifecmd)
|
||||
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
|
||||
;;
|
||||
(knifesubcmd)
|
||||
case $words[2] in
|
||||
(bluebox|ec2|rackspace|slicehost|terremark)
|
||||
compadd "$@" server images
|
||||
;;
|
||||
(client)
|
||||
compadd -Q "$@" "bulk delete" list create show delete edit reregister
|
||||
;;
|
||||
(configure)
|
||||
compadd "$@" client
|
||||
;;
|
||||
(cookbook)
|
||||
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
|
||||
;;
|
||||
(node)
|
||||
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
|
||||
;;
|
||||
(recipe)
|
||||
compadd "$@" list
|
||||
;;
|
||||
(role)
|
||||
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
|
||||
;;
|
||||
(windows)
|
||||
compadd "$@" bootstrap
|
||||
;;
|
||||
(*)
|
||||
_arguments '2:Subsubcommands:($(_knife_options1))'
|
||||
esac
|
||||
;;
|
||||
(knifesubcmd2)
|
||||
case $words[3] in
|
||||
(server)
|
||||
compadd "$@" list create delete
|
||||
;;
|
||||
(images)
|
||||
compadd "$@" list
|
||||
;;
|
||||
(site)
|
||||
compadd "$@" vendor show share search download list unshare
|
||||
;;
|
||||
(show|delete|edit)
|
||||
_arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
|
||||
;;
|
||||
(upload|test)
|
||||
_arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
|
||||
;;
|
||||
(list)
|
||||
compadd -a "$@" knife_general_flags
|
||||
;;
|
||||
(bag)
|
||||
compadd -Q "$@" show edit list "from file" create delete
|
||||
;;
|
||||
(*)
|
||||
_arguments '3:Subsubcommands:($(_knife_options2))'
|
||||
esac
|
||||
;;
|
||||
(knifesubcmd3)
|
||||
case $words[3] in
|
||||
(show)
|
||||
case $words[2] in
|
||||
(cookbook)
|
||||
versioncomp=1
|
||||
_arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
|
||||
;;
|
||||
(node|client|role)
|
||||
compadd "$@" --attribute
|
||||
esac
|
||||
esac
|
||||
case $words[4] in
|
||||
(show|edit)
|
||||
_arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
|
||||
;;
|
||||
(file)
|
||||
_arguments '*:file or directory:_files -g "*.(rb|json)"'
|
||||
;;
|
||||
(list)
|
||||
compadd -a "$@" knife_general_flags
|
||||
;;
|
||||
(*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
esac
|
||||
;;
|
||||
(knifesubcmd4)
|
||||
if (( versioncomp > 0 )); then
|
||||
compadd "$@" attributes definitions files libraries providers recipes resources templates
|
||||
else
|
||||
_arguments '*:Subsubcommands:($(_knife_options2))'
|
||||
fi
|
||||
;;
|
||||
(knifesubcmd5)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
esac
|
||||
}
|
||||
|
||||
# Helper functions to provide the argument completion for several depths of commands
|
||||
function _knife_options1() {
|
||||
( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
|
||||
}
|
||||
|
||||
function _knife_options2() {
|
||||
( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
|
||||
}
|
||||
|
||||
function _knife_options3() {
|
||||
( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
|
||||
}
|
||||
|
||||
# The chef_x_remote functions use knife to get a list of objects of type x on the server
|
||||
function _chef_roles_remote() {
|
||||
(knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
|
||||
}
|
||||
|
||||
function _chef_clients_remote() {
|
||||
(knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
|
||||
}
|
||||
|
||||
function _chef_nodes_remote() {
|
||||
(knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
|
||||
}
|
||||
|
||||
function _chef_cookbooks_remote() {
|
||||
(knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
|
||||
}
|
||||
|
||||
function _chef_sitecookbooks_remote() {
|
||||
(knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
|
||||
}
|
||||
|
||||
function _chef_data_bags_remote() {
|
||||
(knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
|
||||
}
|
||||
|
||||
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
|
||||
function _chef_cookbooks_local() {
|
||||
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)
|
||||
}
|
||||
|
||||
# This function extracts the available cookbook versions on the chef server
|
||||
function _cookbook_versions() {
|
||||
(knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g')
|
||||
}
|
||||
|
||||
function _knife "$@"
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
#compdef cpanm
|
||||
|
||||
##
|
||||
# cpanminus Z Shell completion script
|
||||
##
|
||||
#
|
||||
# Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011)
|
||||
#
|
||||
# The latest code is always located at:
|
||||
# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
|
||||
#
|
||||
|
||||
local arguments curcontext="$curcontext"
|
||||
typeset -A opt_args
|
||||
|
||||
|
||||
arguments=(
|
||||
|
||||
# Commands
|
||||
# '(--install -i)'{--install,-i}'[Installs the modules]'
|
||||
'(- :)--self-upgrade[Upgrades itself]'
|
||||
'(- :)--info[Displays distribution info on CPAN]'
|
||||
'(--installdeps)--installdeps[Only install dependencies]'
|
||||
'(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
|
||||
'(- :)'{--help,-h}'[Displays help information]'
|
||||
'(- :)'{--version,-V}'[Displays software version]'
|
||||
|
||||
# Options
|
||||
{--force,-f}'[Force install]'
|
||||
{--notest,-n}'[Do not run unit tests]'
|
||||
{--sudo,-S}'[sudo to run install commands]'
|
||||
'(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
|
||||
'(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
|
||||
{--local-lib,-l}'[Specify the install base to install modules]'
|
||||
{--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
|
||||
'--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
|
||||
'--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
|
||||
'--prompt[Prompt when configure/build/test fails]'
|
||||
'--reinstall[Reinstall the distribution even if you already have the latest version installed]'
|
||||
'--interactive[Turn on interactive configure]'
|
||||
|
||||
'--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
|
||||
'--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
|
||||
|
||||
'--save-dists[Specify the optional directory path to copy downloaded tarballs]'
|
||||
# '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
|
||||
|
||||
'--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
|
||||
'(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
|
||||
'(--man-pages)--no-man-pages[Do not generate man pages]'
|
||||
|
||||
|
||||
# Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
|
||||
# Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
|
||||
# (So that the exclusions are not enabled here for the completion)
|
||||
'(--lwp)--lwp[Use LWP module to download stuff]'
|
||||
'(--wget)--wget[Use GNU Wget (if available) to download stuff]'
|
||||
'(--curl)--curl[Use cURL (if available) to download stuff]'
|
||||
|
||||
# Other completions
|
||||
'*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
|
||||
# '*::args: _normal' # this looks for default files (any files)
|
||||
)
|
||||
_arguments -s $arguments \
|
||||
&& return 0
|
||||
|
||||
return 1
|
|
@ -1,36 +0,0 @@
|
|||
#compdef gas
|
||||
#autoload
|
||||
|
||||
local curcontext="$curcontext" state line cmds ret=1
|
||||
|
||||
_arguments -C \
|
||||
'(- 1 *)'{-v,--version}'[display version information]' \
|
||||
'(-h|--help)'{-h,--help}'[show help information]' \
|
||||
'1: :->cmds' \
|
||||
'*: :->args' && ret=0
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
cmds=(
|
||||
"version:Prints Gas's version"
|
||||
"use:Uses author"
|
||||
"show:Shows your current user"
|
||||
"list:Lists your authors"
|
||||
"import:Imports current user to gasconfig"
|
||||
"help:Describe available tasks or one specific task"
|
||||
"delete:Deletes author"
|
||||
"add:Adds author to gasconfig"
|
||||
)
|
||||
_describe -t commands 'gas command' cmds && ret=0
|
||||
;;
|
||||
(args)
|
||||
case "$line[1]" in
|
||||
(use|delete)
|
||||
_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
|
|
@ -1,332 +0,0 @@
|
|||
#!zsh
|
||||
#
|
||||
# Installation
|
||||
# ------------
|
||||
#
|
||||
# To achieve git-flow completion nirvana:
|
||||
#
|
||||
# 0. Update your zsh's git-completion module to the newest verion.
|
||||
# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
|
||||
#
|
||||
# 1. Install this file. Either:
|
||||
#
|
||||
# a. Place it in your .zshrc:
|
||||
#
|
||||
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
|
||||
# your .zshrc:
|
||||
#
|
||||
# source ~/.git-flow-completion.zsh
|
||||
#
|
||||
# c. Or, use this file as a oh-my-zsh plugin.
|
||||
#
|
||||
|
||||
_git-flow ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'init:Initialize a new git repo with support for the branching model.'
|
||||
'feature:Manage your feature branches.'
|
||||
'release:Manage your release branches.'
|
||||
'hotfix:Manage your hotfix branches.'
|
||||
'support:Manage your support branches.'
|
||||
'version:Shows version information.'
|
||||
)
|
||||
_describe -t commands 'git flow' subcommands
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(init)
|
||||
_arguments \
|
||||
-f'[Force setting of gitflow branches, even if already configured]'
|
||||
;;
|
||||
|
||||
(version)
|
||||
;;
|
||||
|
||||
(hotfix)
|
||||
__git-flow-hotfix
|
||||
;;
|
||||
|
||||
(release)
|
||||
__git-flow-release
|
||||
;;
|
||||
|
||||
(feature)
|
||||
__git-flow-feature
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-release ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new release branch.'
|
||||
'finish:Finish a release branch.'
|
||||
'list:List all your release branches. (Alias to `git flow release`)'
|
||||
)
|
||||
_describe -t commands 'git flow release' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
':version:__git_flow_version_list'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-hotfix ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new hotfix branch.'
|
||||
'finish:Finish a hotfix branch.'
|
||||
'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
|
||||
)
|
||||
_describe -t commands 'git flow hotfix' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':hotfix:__git_flow_version_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-s'[Sign the release tag cryptographically]'\
|
||||
-u'[Use the given GPG-key for the digital signature (implies -s)]'\
|
||||
-m'[Use the given tag message]'\
|
||||
-p'[Push to $ORIGIN after performing finish]'\
|
||||
':hotfix:__git_flow_hotfix_list'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git-flow-feature ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
|
||||
local -a subcommands
|
||||
subcommands=(
|
||||
'start:Start a new feature branch.'
|
||||
'finish:Finish a feature branch.'
|
||||
'list:List all your feature branches. (Alias to `git flow feature`)'
|
||||
'publish: public'
|
||||
'track: track'
|
||||
'diff: diff'
|
||||
'rebase: rebase'
|
||||
'checkout: checkout'
|
||||
'pull: pull'
|
||||
)
|
||||
_describe -t commands 'git flow feature' subcommands
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
|
||||
(start)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]'\
|
||||
':feature:__git_flow_feature_list'\
|
||||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(finish)
|
||||
_arguments \
|
||||
-F'[Fetch from origin before performing finish]' \
|
||||
-r'[Rebase instead of merge]'\
|
||||
':feature:__git_flow_feature_list'
|
||||
;;
|
||||
|
||||
(publish)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(track)
|
||||
_arguments \
|
||||
':feature:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(diff)
|
||||
_arguments \
|
||||
':branch:__git_branch_names'\
|
||||
;;
|
||||
|
||||
(rebase)
|
||||
_arguments \
|
||||
-i'[Do an interactive rebase]' \
|
||||
':branch:__git_branch_names'
|
||||
;;
|
||||
|
||||
(checkout)
|
||||
_arguments \
|
||||
':branch:__git_flow_feature_list'\
|
||||
;;
|
||||
|
||||
(pull)
|
||||
_arguments \
|
||||
':remote:__git_remotes'\
|
||||
':branch:__git_branch_names'
|
||||
;;
|
||||
|
||||
*)
|
||||
_arguments \
|
||||
-v'[Verbose (more) output]'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_version_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a versions
|
||||
|
||||
versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted versions expl 'version' compadd $versions
|
||||
}
|
||||
|
||||
__git_flow_feature_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a features
|
||||
|
||||
features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted features expl 'feature' compadd $features
|
||||
}
|
||||
|
||||
__git_remotes () {
|
||||
local expl gitdir remotes
|
||||
|
||||
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
|
||||
__git_command_successful || return
|
||||
|
||||
remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
|
||||
__git_command_successful || return
|
||||
|
||||
# TODO: Should combine the two instead of either or.
|
||||
if (( $#remotes > 0 )); then
|
||||
_wanted remotes expl remote compadd $* - $remotes
|
||||
else
|
||||
_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
|
||||
fi
|
||||
}
|
||||
|
||||
__git_flow_hotfix_list ()
|
||||
{
|
||||
local expl
|
||||
declare -a hotfixes
|
||||
|
||||
hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted hotfixes expl 'hotfix' compadd $hotfixes
|
||||
}
|
||||
|
||||
__git_branch_names () {
|
||||
local expl
|
||||
declare -a branch_names
|
||||
|
||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||
__git_command_successful || return
|
||||
|
||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
}
|
||||
|
||||
__git_command_successful () {
|
||||
if (( ${#pipestatus:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'
|
|
@ -1,41 +0,0 @@
|
|||
#compdef github
|
||||
#autoload
|
||||
|
||||
# The github-gem is neccessary for this completion to work.
|
||||
# http://github.com/defunkt/github-gem
|
||||
|
||||
# This completion is based on the Homebrew completion.
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'browse:Open this repo in a web browser'
|
||||
'clone:Clone a repo'
|
||||
'config:Automatically set configuration info, or pass args to specify'
|
||||
'create-from-local:Create a new GitHub repository from the current local repository'
|
||||
'create:Create a new empty GitHub repository'
|
||||
'fetch:Fetch from a remote to a local branch'
|
||||
'fetch_all:Fetch all refs from a user'
|
||||
'fork:Forks a GitHub repository'
|
||||
'home:Open this repos master branch in a web browser'
|
||||
'ignore:Ignore a SHA from github network commits'
|
||||
'info:Info about this project'
|
||||
'issues:Project issues tools'
|
||||
'network:Project network tools - sub-commands : web [user], list, fetch, commits'
|
||||
'open:Open the given user/project in a web browser'
|
||||
'pull-request:Generate the text for a pull request'
|
||||
'pull:Pull from a remote'
|
||||
'search:Search GitHub for the given repository name'
|
||||
'track:Track another users repository'
|
||||
)
|
||||
|
||||
local expl
|
||||
local -a pkgs installed_pkgs
|
||||
|
||||
_arguments \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "github subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
#compdef heroku
|
||||
#autoload
|
||||
|
||||
# Heroku Autocomplete plugin for Oh-My-Zsh
|
||||
# Requires: The Heroku client gem (https://github.com/heroku/heroku)
|
||||
# Author: Ali B. (http://awhitebox.com)
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
"account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
|
||||
"addons":"list installed addons"
|
||||
"addons\:list":"list all available addons"
|
||||
"addons\:add":"install an addon"
|
||||
"addons\:upgrade":"upgrade an existing addon"
|
||||
"addons\:downgrade":"downgrade an existing addon"
|
||||
"addons\:remove":"uninstall an addon"
|
||||
"addons\:open":"open an addon's dashboard in your browser"
|
||||
"apps":"list your apps"
|
||||
"apps\:info":"show detailed app information"
|
||||
"apps\:create":"create a new app"
|
||||
"apps\:rename":"rename the app"
|
||||
"apps\:open":"open the app in a web browser"
|
||||
"apps\:destroy":"permanently destroy an app"
|
||||
"auth\:login":"log in with your heroku credentials"
|
||||
"auth\:logout":"clear local authentication credentials"
|
||||
"config":"display the config vars for an app"
|
||||
"config\:add":"add one or more config vars"
|
||||
"config\:remove":"remove a config var"
|
||||
"db\:push":"push local data up to your app"
|
||||
"db\:pull":"pull heroku data down into your local database"
|
||||
"domains":"list custom domains for an app"
|
||||
"domains\:add":"add a custom domain to an app"
|
||||
"domains\:remove":"remove a custom domain from an app"
|
||||
"domains\:clear":"remove all custom domains from an app"
|
||||
"help":"list available commands or display help for a specific command"
|
||||
"keys":"display keys for the current user"
|
||||
"keys\:add":"add a key for the current user"
|
||||
"keys\:remove":"remove a key from the current user"
|
||||
"keys\:clear":"remove all authentication keys from the current user"
|
||||
"logs":"display recent log output"
|
||||
"logs\:cron":"DEPRECATED: display cron logs from legacy logging"
|
||||
"logs\:drains":"manage syslog drains"
|
||||
"maintenance\:on":"put the app into maintenance mode"
|
||||
"maintenance\:off":"take the app out of maintenance mode"
|
||||
"pg\:info":"display database information"
|
||||
"pg\:ingress":"allow direct connections to the database from this IP for one minute"
|
||||
"pg\:promote":"sets DATABASE as your DATABASE_URL"
|
||||
"pg\:psql":"open a psql shell to the database"
|
||||
"pg\:reset":"delete all data in DATABASE"
|
||||
"pg\:unfollow":"stop a replica from following and make it a read/write database"
|
||||
"pg\:wait":"monitor database creation, exit when complete"
|
||||
"pgbackups":"list captured backups"
|
||||
"pgbackups\:url":"get a temporary URL for a backup"
|
||||
"pgbackups\:capture":"capture a backup from a database id"
|
||||
"pgbackups\:restore":"restore a backup to a database"
|
||||
"pgbackups\:destroy":"destroys a backup"
|
||||
"plugins":"list installed plugins"
|
||||
"plugins\:install":"install a plugin"
|
||||
"plugins\:uninstall":"uninstall a plugin"
|
||||
"ps\:dynos":"scale to QTY web processes"
|
||||
"ps\:workers":"scale to QTY background processes"
|
||||
"ps":"list processes for an app"
|
||||
"ps\:restart":"restart an app process"
|
||||
"ps\:scale":"scale processes by the given amount"
|
||||
"releases":"list releases"
|
||||
"releases\:info":"view detailed information for a release"
|
||||
"rollback":"roll back to an older release"
|
||||
"run":"run an attached process"
|
||||
"run\:rake":"remotely execute a rake command"
|
||||
"run\:console":"open a remote console session"
|
||||
"sharing":"list collaborators on an app"
|
||||
"sharing\:add":"add a collaborator to an app"
|
||||
"sharing\:remove":"remove a collaborator from an app"
|
||||
"sharing\:transfer":"transfer an app to a new owner"
|
||||
"ssl":"list certificates for an app"
|
||||
"ssl\:add":"add an ssl certificate to an app"
|
||||
"ssl\:remove":"remove an ssl certificate from an app"
|
||||
"ssl\:clear":"remove all ssl certificates from an app"
|
||||
"stack":"show the list of available stacks"
|
||||
"stack\:migrate":"prepare migration of this app to a new stack"
|
||||
"version":"show heroku client version"
|
||||
)
|
||||
|
||||
_arguments '*:: :->command'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "heroku command" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
apps:info)
|
||||
_command_args=(
|
||||
'(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
|
||||
)
|
||||
;;
|
||||
apps:create)
|
||||
_command_args=(
|
||||
'(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
|
||||
'(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
|
||||
'(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
|
||||
)
|
||||
;;
|
||||
config)
|
||||
_command_args=(
|
||||
'(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
|
||||
)
|
||||
;;
|
||||
db:push)
|
||||
_command_args=(
|
||||
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
|
||||
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
|
||||
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
|
||||
'(-f|--filter)'{-f,--filter}'[only push certain tables]' \
|
||||
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
|
||||
'(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
|
||||
)
|
||||
;;
|
||||
db:pull)
|
||||
_command_args=(
|
||||
'(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
|
||||
'(-d|--debug)'{-d,--debug}'[enable debugging output]' \
|
||||
'(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
|
||||
'(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
|
||||
'(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
|
||||
'(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
|
||||
)
|
||||
;;
|
||||
keys)
|
||||
_command_args=(
|
||||
'(-l|--long)'{-l,--long}'[display extended information for each key]' \
|
||||
)
|
||||
;;
|
||||
logs)
|
||||
_command_args=(
|
||||
'(-n|--num)'{-n,--num}'[the number of lines to display]' \
|
||||
'(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
|
||||
'(-s|--source)'{-s,--source}'[only display logs from the given source]' \
|
||||
'(-t|--tail)'{-t,--tail}'[continually stream logs]' \
|
||||
)
|
||||
;;
|
||||
pgbackups:capture)
|
||||
_command_args=(
|
||||
'(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
|
||||
)
|
||||
;;
|
||||
stack)
|
||||
_command_args=(
|
||||
'(-a|--all)'{-a,--all}'[include deprecated stacks]' \
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments \
|
||||
$_command_args \
|
||||
'(--app)--app[the app name]' \
|
||||
&& return 0
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
function _lein_commands() {
|
||||
local ret=1 state
|
||||
_arguments ':subcommand:->subcommand' && ret=0
|
||||
|
||||
case "$state" in
|
||||
subcommand)
|
||||
subcommands=(
|
||||
"clean:remove compiled files and dependencies from project"
|
||||
"compile:ahead-of-time compile the project"
|
||||
"deps:download and install all dependencies"
|
||||
"help:display a list of tasks or help for a given task"
|
||||
"install:install the project and its dependencies in your local repository"
|
||||
"jar:create a jar file containing the compiled .class files"
|
||||
"new:create a new project skeleton"
|
||||
"pom:write a pom.xml file to disk for maven interop"
|
||||
"test:run the project's tests"
|
||||
"uberjar:Create a jar including the contents of each of deps"
|
||||
"upgrade:upgrade leiningen to the latest stable release"
|
||||
"version:print leiningen's version"
|
||||
)
|
||||
_describe -t subcommands 'leiningen subcommands' subcommands && ret=0
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
compdef _lein_commands lein
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
#compdef port
|
||||
|
||||
local subcmds
|
||||
|
||||
# we cache the list of ports
|
||||
# we shall use some cache policy to avoid problems with new ports
|
||||
if (( ! $+portlist )); then
|
||||
portlist=($(port echo all; echo "all current active inactive installed uninstalled outdated"))
|
||||
fi
|
||||
|
||||
subcmds=(
|
||||
'activate'
|
||||
'archive'
|
||||
'build'
|
||||
'cat'
|
||||
'clean'
|
||||
'configure'
|
||||
'contents'
|
||||
'deactivate'
|
||||
'dependents'
|
||||
'deps'
|
||||
'destroot'
|
||||
'dir'
|
||||
'distcheck'
|
||||
'distclean'
|
||||
'dmg'
|
||||
'echo'
|
||||
'edit'
|
||||
'extract'
|
||||
'fetch'
|
||||
'file'
|
||||
'help'
|
||||
'info'
|
||||
'install'
|
||||
'installed'
|
||||
'list'
|
||||
'livecheck'
|
||||
'location'
|
||||
'mpkg'
|
||||
'outdated'
|
||||
'patch'
|
||||
'pkg'
|
||||
'provides'
|
||||
'rpmpackage'
|
||||
'search'
|
||||
'selfupdate'
|
||||
'sync'
|
||||
'test'
|
||||
'unarchive'
|
||||
'uninstall'
|
||||
'upgrade'
|
||||
'variants'
|
||||
'version'
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
'-v[verbose mode (generate verbose messages)]' \
|
||||
'-d[debug mode (generate debugging messages)]' \
|
||||
'-q[quiet mode (suppress messages)]' \
|
||||
'-D[specify portdir]' \
|
||||
'-k[keep mode (do not autoclean after install)]' \
|
||||
'-n[dont follow dependencies in upgrade (only for upgrading)]' \
|
||||
'-a[upgrade all installed ports (only for upgrading)]' \
|
||||
'-u[uninstall non-active ports when upgrading and uninstalling]' \
|
||||
'-f[force mode (ignore state file)]' \
|
||||
'-s[source-only mode]' \
|
||||
'-b[binary-only mode]' \
|
||||
'-o[honor state files older than Portfile]' \
|
||||
'*::command:->command' \
|
||||
&& return 0
|
||||
|
||||
case $state in
|
||||
command)
|
||||
if ((CURRENT == 1)); then
|
||||
state=subcommands
|
||||
else
|
||||
state=portname
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
case $state in
|
||||
subcommands)
|
||||
_describe -t commands 'port commands' subcmds
|
||||
;;
|
||||
portname)
|
||||
_describe -t commands 'available ports' portlist
|
||||
;;
|
||||
esac
|
|
@ -1,21 +0,0 @@
|
|||
function _phing_does_target_list_need_generating() {
|
||||
if [[ ! -f .phing_targets ]]; then
|
||||
return 0
|
||||
else
|
||||
accurate=$(stat -f%m .phing_targets)
|
||||
changed=$(stat -f%m build.xml)
|
||||
return $(expr $accurate '>=' $changed)
|
||||
fi
|
||||
}
|
||||
|
||||
function _phing() {
|
||||
if [[ -f build.xml ]]; then
|
||||
if _phing_does_target_list_need_generating; then
|
||||
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
|
||||
fi
|
||||
compadd `cat .phing_targets`
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _phing phing
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#compdef powder
|
||||
#autoload
|
||||
|
||||
compadd `powder help | grep powder | cut -d " " -f 4`
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#compdef pip
|
||||
#autoload
|
||||
|
||||
# This completion is based on the Homebrew completion.
|
||||
|
||||
function _pip-installed() {
|
||||
installed_pkgs=(`pip freeze`)
|
||||
}
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'bundle:Create pybundles (archives containing multiple packages)'
|
||||
'freeze:Output all currently installed packages (exact versions) to stdout'
|
||||
'help:Show available commands'
|
||||
'install:Install packages'
|
||||
'search:Search PyPI'
|
||||
'uninstall:Uninstall packages'
|
||||
'unzip:Unzip individual packages'
|
||||
'zip:Zip individual packages'
|
||||
)
|
||||
|
||||
local expl
|
||||
local -a pkgs installed_pkgs
|
||||
|
||||
_arguments \
|
||||
'(--version)--version[Show version number of program and exit]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Give more output]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[Give less output]' \
|
||||
'(-h --help)'{-h,--help}'[Show help]' \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "pip subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
case "$words[1]" in
|
||||
list)
|
||||
if [[ "$state" == forms ]]; then
|
||||
_pip-installed
|
||||
_requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
|
||||
fi ;;
|
||||
uninstall)
|
||||
_pip-installed
|
||||
_wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
|
||||
esac
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
#compdef redis-cli rec
|
||||
#autoload
|
||||
|
||||
# This completion is based on the Homebrew completion.
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'append:append a value to a key'
|
||||
'auth:authenticate to the server'
|
||||
'bgrewriteeaof:asynchronously rewrite the append-only file'
|
||||
'bgsave:asynchornously save the dataset to disk'
|
||||
'blpop:remove and get the first element in a list, or block until one is available'
|
||||
'brpop:remove and get the last element in a list, or block until one is available'
|
||||
'brpoplpush:pop a value from a list, push it to another list and return it; or block until one is available'
|
||||
# 'config get:get the value of a configuration parameter'
|
||||
# 'config set:set a configuration parameter to the given value'
|
||||
# 'config resetstat: reset the stats returned by INFO'
|
||||
'dbsize:return the number of keys in the selected database'
|
||||
# 'debug object:get debugging information about a key'
|
||||
# 'debug setgfault:make the server crash'
|
||||
'decr:decrement the integer value of a key by one'
|
||||
'decrby:decrement the integet value of a key by the given number'
|
||||
'del:delete a key'
|
||||
'discard:discard all commands issued after MULTI'
|
||||
'echo:echo the given string'
|
||||
'exec:execute all commands issued after a MULTI'
|
||||
'exists:determine if a key exists'
|
||||
'expire:set the time to live for a key, in seconds'
|
||||
'expireat:set the expiration for a key as a UNIX timestamp'
|
||||
'flushall:remove all keys from all databases'
|
||||
'flushdb:remove all keys from the current database'
|
||||
'get:get the value of a key'
|
||||
'getbit:returns the bit value at offset in the string value stored at key'
|
||||
'getrange:get a substring of the string stored at a key'
|
||||
'getset:set the string value of a key and return its old value'
|
||||
'hdel:delete a hash field'
|
||||
'hexists:determine if a hash field exists'
|
||||
'hget:get the value of a hash field'
|
||||
'hgetall:get all the fields and values in a hash'
|
||||
'hincrby:increment the integer value of a hash field by the given number'
|
||||
'hkeys:get all the fields in a hash'
|
||||
'hlen:get the number of fields in a hash'
|
||||
'hmget:get the values of all the given hash fields'
|
||||
'hmset:set multiple hash fields to multiple values'
|
||||
'hset:set the string value of a hash field'
|
||||
'hsetnx:set the value of a hash field, only if the field does not exist'
|
||||
'hvals:get all the values in a hash'
|
||||
'incr:increment the integer value of a key by one'
|
||||
'incrby:increment the integer value of a key by the given number'
|
||||
'info:get information and statistics about the server'
|
||||
'keys:find all keys matching the given pattern'
|
||||
'lastsave:get the UNIX timestamp of the last successful save to disk'
|
||||
'lindex:get an element from a list by its index'
|
||||
'linsert:insert an element before or after another element in a list'
|
||||
'llen:get the length of a list'
|
||||
'lpop:remove and get the first element in a list'
|
||||
'lpush:prepend a value to a list'
|
||||
'lpushx:prepend a value to a list, only if the list exists'
|
||||
'lrange:get a range of elements from a list'
|
||||
'lrem:remove elements from a list'
|
||||
'lset:set the value of an element in a list by its index'
|
||||
'ltrim:trim a list to the specified range'
|
||||
'mget:get the values of all the given keys'
|
||||
'monitor:listen for all requests received by the server in real time'
|
||||
'move:move a key to another database'
|
||||
'mset:set multiple keys to muliple values'
|
||||
'msetnx:set multiple keys tom ultiple values, only if none of the keys exist'
|
||||
'multi:mark the start of a transaction block'
|
||||
'object:inspect the internals of Redis objects'
|
||||
'persist:remove the expiration from a key'
|
||||
'ping:ping the server'
|
||||
'psubscribe:listen for messages published to channels matching the given patterns'
|
||||
'publish:post a message to a channel'
|
||||
'punsubscribe:stop listening for messages posted to channels matching the given patterns'
|
||||
'quit:close the connection'
|
||||
'randomkey:return a random key from the keyspace'
|
||||
'rename:rename a key'
|
||||
'renamenx:rename a key, only if the new key does not exist'
|
||||
'rpop:remove and get the last element in a list'
|
||||
'rpoplpush:remove the last element in a list, append it to another list and return it'
|
||||
'rpush:append a value to a list'
|
||||
'rpushx:append a value to a list, only if the list exists'
|
||||
'sadd:add a member to a set'
|
||||
'save:synchronously save the dataset to disk'
|
||||
'scard:get the number of members in a set'
|
||||
'sdiff:subtract multiple sets'
|
||||
'sdiffstore:subtract multiple sets and store the resulting set in a key'
|
||||
'select:change the selected database for the current connection'
|
||||
'set:set the string value of a key'
|
||||
'setbit:sets or clears the bit at offset in the string value stored at key'
|
||||
'setex:set the value and expiration of a key'
|
||||
'setnx:set the value of a key, only if the key does not exist'
|
||||
'setrange:overwrite part of a string at key starting at the specified offset'
|
||||
'shutdown:synchronously save the dataset to disk and then shut down the server'
|
||||
'sinter:intersect multiple sets'
|
||||
'sinterstore:intersect multiple sets and store the resulting set in a key'
|
||||
'sismember:determine if a given value is a member of a set'
|
||||
'slaveof:make the server a slave of another instance, or promote it as master'
|
||||
'smembers:get all the members in a set'
|
||||
'smove:move a member from one set to another'
|
||||
'sort:sort the elements in a list, set or sorted set'
|
||||
'spop:remove and return a random member from a set'
|
||||
'srandmember:get a random member from a set'
|
||||
'srem:remove a member from a set'
|
||||
'strlen:get the length of the value stored in a key'
|
||||
'subscribe:listen for messages published to the given channels'
|
||||
'sunion:add multiple sets'
|
||||
'sunionstore:add multiple sets and store the resulting set in a key'
|
||||
'ttl:get the time to live for a key'
|
||||
'type:determine the type stored at key'
|
||||
'unsubscribe:stop listening for messages posted to the given channels'
|
||||
'unwatch:forget about all watched keys'
|
||||
'watch:watch the given keys to determine execution of the MULTI/EXEC block'
|
||||
'zadd:add a member to a sorted set, or update its score if it already exists'
|
||||
'zcard:get the number of members in a sorted set'
|
||||
'zcount:count the members in a sorted set with scores within the given values'
|
||||
'zincrby:increment the score of a member in a sorted set'
|
||||
'zinterstore:intersect multiple sorted sets and store the resulting sorted set in a new key'
|
||||
'zrange:return a range of members in a sorted set, by index'
|
||||
'zrangebyscore:return a range of members in a sorted set, by score'
|
||||
'zrank:determine the index of a member in a sorted set'
|
||||
'zrem:remove a member from a sorted set'
|
||||
'zremrangebyrank:remove all members in a sorted set within the given indexes'
|
||||
'zremrangebyscore:remove all members in a sorted set within the given scores'
|
||||
'zrevrange:return a range of membrs in a sorted set, by index, with scores ordered from high to low'
|
||||
'zrevrangebyscore:return a range of members in a sorted set, by score, with scores ordered from high to low'
|
||||
'zrevrank:determine the index of a member in a sorted set, with scores ordered from high to low'
|
||||
'zscore:get the score associated with the given member in a sorted set'
|
||||
'zunionstore:add multiple sorted sets and store te resulting sorted set in a new key'
|
||||
)
|
||||
|
||||
local expl
|
||||
|
||||
_arguments \
|
||||
'(-v --version)'{-v,--version}'[show version]' \
|
||||
'(-h --help)'{-h,--help}'[show help]' \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "redis-cli subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
1
plugins/ruby/.gitignore
vendored
1
plugins/ruby/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
_rvm
|
|
@ -1,67 +0,0 @@
|
|||
#compdef gem
|
||||
#autoload
|
||||
|
||||
# This completion is based on the Homebrew completion.
|
||||
|
||||
function _gem-installed() {
|
||||
installed_gems=(`gem list --local --no-versions`)
|
||||
}
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'cert:Manage RubyGems certificates and signing settings'
|
||||
'check:Check installed gems'
|
||||
'cleanup:Clean up old versions of installed gems in the local repository'
|
||||
'contents:Display the contents of the installed gems'
|
||||
'dependency:Show the dependencies of an installed gem'
|
||||
'environment:Display information about the RubyGems environment'
|
||||
'fetch:Download a gem and place it in the current directory'
|
||||
'generate_index:Generates the index files for a gem server directory'
|
||||
'help:Provide help on the `gem` command'
|
||||
'install:Install a gem into the local repository'
|
||||
'list:Display gems whose name starts with STRING'
|
||||
'lock:Generate a lockdown list of gems'
|
||||
'mirror:Mirror a gem repository'
|
||||
'outdated:Display all gems that need updates'
|
||||
'owner:Manage gem owners on RubyGems.org.'
|
||||
'pristine:Restores installed gems to pristine condition from files located in the gem cache'
|
||||
'push:Push a gem up to RubyGems.org'
|
||||
'query:Query gem information in local or remote repositories'
|
||||
'rdoc:Generates RDoc for pre-installed gems'
|
||||
'search:Display all gems whose name contains STRING'
|
||||
'server:Documentation and gem repository HTTP server'
|
||||
'sources:Manage the sources and cache file RubyGems uses to search for gems'
|
||||
'specification:Display gem specification (in yaml)'
|
||||
'stale:List gems along with access times'
|
||||
'uninstall:Uninstall gems from the local repository'
|
||||
'unpack:Unpack an installed gem to the current directory'
|
||||
'update:Update the named gems (or all installed gems) in the local repository'
|
||||
'which:Find the location of a library file you can require'
|
||||
)
|
||||
|
||||
local expl
|
||||
local -a gems installed_gems
|
||||
|
||||
_arguments \
|
||||
'(-v --version)'{-v,--version}'[show version]' \
|
||||
'(-h --help)'{-h,--help}'[show help]' \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "gem subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
case "$words[1]" in
|
||||
(list)
|
||||
if [[ "$state" == 'forms' ]]; then
|
||||
_gem-installed
|
||||
_requested installed_gems expl 'installed gems' compadd -a installed_gems
|
||||
fi
|
||||
;;
|
||||
(uninstall|update)
|
||||
_gem-installed
|
||||
_wanted installed_gems expl 'installed gems' compadd -a installed_gems
|
||||
;;
|
||||
esac
|
||||
|
|
@ -15,27 +15,13 @@ if [[ "$OSTYPE" == darwin* ]]; then
|
|||
fi
|
||||
|
||||
# Loads RVM into the shell session.
|
||||
completion_file="${0:h}/_rvm"
|
||||
if [[ ! -e "$completion_file" ]] && [[ -L "$completion_file" ]]; then
|
||||
unlink "$completion_file" 2> /dev/null
|
||||
fi
|
||||
|
||||
if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
|
||||
# Auto adding variable-stored paths to ~ list conflicts with RVM.
|
||||
unsetopt auto_name_dirs
|
||||
|
||||
# Source RVM.
|
||||
source "$HOME/.rvm/scripts/rvm"
|
||||
|
||||
# Complete RVM.
|
||||
if [[ ! -e "$completion_file" ]]; then
|
||||
ln -s \
|
||||
"$rvm_path/scripts/zsh/Completion/_rvm" \
|
||||
"$completion_file" \
|
||||
2> /dev/null
|
||||
fi
|
||||
fi
|
||||
unset completion_file
|
||||
|
||||
# Loads rbenv into the shell session.
|
||||
if [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then
|
||||
|
|
1
plugins/taskwarrior/.gitignore
vendored
1
plugins/taskwarrior/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
_task
|
|
@ -1,25 +0,0 @@
|
|||
# Complete task.
|
||||
completion_file="${0:h}/_task"
|
||||
if [[ ! -e "$completion_file" ]] && ; then
|
||||
if [[ -L "$completion_file" ]]; then
|
||||
unlink "$completion_file" 2> /dev/null
|
||||
fi
|
||||
|
||||
if (( $+commands[taskwarrior] )); then
|
||||
ln -s \
|
||||
"${commands[task]:h:h}/share/doc/task/scripts/zsh/_task" \
|
||||
"$completion_file" \
|
||||
2> /dev/null
|
||||
fi
|
||||
fi
|
||||
unset completion_file
|
||||
|
||||
# Style
|
||||
zstyle ':completion:*:*:task:*' verbose yes
|
||||
zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u'
|
||||
zstyle ':completion:*:*:task:*' group-name ''
|
||||
|
||||
# Aliases
|
||||
alias t=task
|
||||
compdef _task t=task
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#compdef thor
|
||||
#autoload
|
||||
|
||||
compadd `thor list | grep thor | cut -d " " -f 2`
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
#compdef vagrant
|
||||
#autoload
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'box:Box commands'
|
||||
'destroy:Destroys the vagrant environment'
|
||||
'halt:Halts the currently running vagrant environment'
|
||||
'help:[TASK] Describe available tasks or one specific task'
|
||||
'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
|
||||
'package:Packages a vagrant environment for distribution'
|
||||
'provision:Run the provisioner'
|
||||
'reload:Reload the vagrant environment'
|
||||
'resume:Resumes a suspend vagrant environment'
|
||||
'ssh:SSH into the currently running environment'
|
||||
'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
|
||||
'status:Shows the status of the current Vagrant environment.'
|
||||
'suspend:Suspends the currently running vagrant environment'
|
||||
'up:Creates the vagrant environment'
|
||||
'version:Prints the Vagrant version information'
|
||||
)
|
||||
|
||||
local -a _box_arguments
|
||||
_box_arguments=(
|
||||
'add:NAME URI Add a box to the system'
|
||||
'help:COMMAND Describe subcommands or one specific subcommand'
|
||||
'list:Lists all installed boxes'
|
||||
'remove:NAME Remove a box from the system'
|
||||
'repackage:NAME Repackage an installed box into a `.box` file.'
|
||||
)
|
||||
|
||||
function __task_list() {
|
||||
local expl
|
||||
declare -a tasks
|
||||
|
||||
tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
|
||||
_wanted tasks expl 'help' compadd $tasks
|
||||
}
|
||||
|
||||
function __box_list() {
|
||||
_wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
|
||||
}
|
||||
|
||||
function __vm_list () {
|
||||
_wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *:\([a-zA-Z0-9]\+\)' 2>/dev/null | cut -d: -f2)
|
||||
}
|
||||
|
||||
function __vagrant-box() {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "gem subcommand" _box_arguments
|
||||
return
|
||||
;;
|
||||
(options)
|
||||
case $line[1] in
|
||||
(repackage|remove)
|
||||
_arguments ':feature:__box_list'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
local expl
|
||||
local -a boxes installed_boxes
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
':command:->command' \
|
||||
'*::options:->options'
|
||||
|
||||
case $state in
|
||||
(command)
|
||||
_describe -t commands "gem subcommand" _1st_arguments
|
||||
return
|
||||
;;
|
||||
|
||||
(options)
|
||||
case $line[1] in
|
||||
(help)
|
||||
_arguments ':feature:__task_list'
|
||||
;;
|
||||
|
||||
(box)
|
||||
__vagrant-box
|
||||
;;
|
||||
(up|provision|package|destroy|reload|ssh|halt|resume|status)
|
||||
_arguments ':feature:__vm_list'
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in a new issue