Commit 18ef1ee6 authored by Dawid Ferenczy's avatar Dawid Ferenczy
Browse files

Merge remote-tracking branch 'robbyrussell/master'

parents eafd5f32 192de6bc
......@@ -16,6 +16,8 @@ alias hgs='hg status'
alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" '
# this is the 'git commit --amend' equivalent
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
# list unresolved files (since hg does not list unmerged files in the status command)
alias hgun='hg resolve --list'
function in_hg() {
if [[ -d .hg ]] || $(hg summary > /dev/null 2>&1); then
......@@ -33,14 +35,14 @@ function hg_prompt_info {
if [ $(in_hg) ]; then
_DISPLAY=$(hg_get_branch_name)
echo "$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_PREFIX\
$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_PROMPT_BASE_COLOR"
$ZSH_THEME_REPO_NAME_COLOR$_DISPLAY$ZSH_PROMPT_BASE_COLOR$ZSH_PROMPT_BASE_COLOR$(hg_dirty)$ZSH_THEME_HG_PROMPT_SUFFIX$ZSH_PROMPT_BASE_COLOR"
unset _DISPLAY
fi
}
function hg_dirty_choose {
if [ $(in_hg) ]; then
hg status 2> /dev/null | grep -Eq '^\s*[ACDIM!?L]'
hg status 2> /dev/null | command grep -Eq '^\s*[ACDIM!?L]'
if [ $pipestatus[-1] -eq 0 ]; then
# Grep exits with 0 when "One or more lines were selected", return "dirty".
echo $1
......
# mix-fast
Fast mix autocompletion plugin.
This script caches the output for later usage and significantly speeds it up.
It generates a .mix_tasks cache file for current project. Currently if you want
to update cache you should remove .mix_tasks file
Inspired by and based on rake-fast zsh plugin.
This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/).
## Installation
Just add the plugin to your `.zshrc`:
```bash
plugins=(foo bar mix-fast)
```
You might consider adding `.mix_tasks` to your [global .gitignore](https://help.github.com/articles/ignoring-files#global-gitignore)
## Usage
`mix`, then press tab
Currently maintained by [styx](https://github.com/styx/)
\ No newline at end of file
_mix_refresh () {
if [ -f .mix_tasks ]; then
rm .mix_tasks
fi
echo "Generating .mix_tasks..." > /dev/stderr
_mix_generate
cat .mix_tasks
}
_mix_does_task_list_need_generating () {
[ ! -f .mix_tasks ];
}
_mix_generate () {
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
}
_mix () {
if [ -f mix.exs ]; then
if _mix_does_task_list_need_generating; then
echo "\nGenerating .mix_tasks..." > /dev/stderr
_mix_generate
fi
compadd `cat .mix_tasks`
fi
}
compdef _mix mix
alias mix_refresh='_mix_refresh'
#compdef mix
#compdef mix
#autoload
# Elixir mix zsh completion
local -a _1st_arguments
_1st_arguments=(
'archive:Archive this project into a .ez file'
'clean:Clean generated application files'
'app.start:Start all registered apps'
'archive:List all archives'
'archive.build:Archive this project into a .ez file'
'archive.install:Install an archive locally'
'archive.uninstall:Uninstall archives'
'clean:Delete generated application files'
'cmd:Executes the given command'
'compile:Compile source files'
'compile.protocols:Consolidates all protocols in all paths'
'deps:List dependencies and their status'
"deps.clean:Remove dependencies' files"
"deps.clean:Remove the given dependencies' files"
'deps.compile:Compile dependencies'
'deps.get:Get all out of date dependencies'
'deps.unlock:Unlock the given dependencies'
'deps.update:Update dependencies'
'do:Executes the commands separated by comma'
'escriptize:Generates an escript for the project'
'deps.update:Update the given dependencies'
'do:Executes the tasks separated by comma'
'escript.build:Builds an escript for the project'
'help:Print help information for tasks'
'hex:Print hex help information'
'hex.config:Read or update hex config'
'hex.docs:Publish docs for package'
'hex.info:Print hex information'
'hex.key:Hex API key tasks'
'hex.outdated:Shows outdated hex deps for the current project'
'hex.owner:Hex package ownership tasks'
'hex.publish:Publish a new package version'
'hex.search:Search for package names'
'hex.user:Hex user tasks'
'loadconfig:Loads and persists the given configuration'
'local:List local tasks'
'local.install:Install a task or an archive locally'
'local.hex:Install hex locally'
'local.rebar:Install rebar locally'
'local.uninstall:Uninstall local tasks or archives'
'new:Creates a new Elixir project'
'new:Create a new Elixir project'
'run:Run the given file or expression'
"test:Run a project's tests"
'--help:Describe available tasks'
......@@ -33,7 +49,7 @@ __task_list ()
local expl
declare -a tasks
tasks=(archive clean compile deps deps.clean deps.compile deps.get deps.unlock deps.update do escriptize help local local.install local.rebar local.uninstall new run test)
tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new run test)
_wanted tasks expl 'help' compadd $tasks
}
......@@ -56,7 +72,7 @@ case $state in
(options)
case $line[1] in
(help)
_arguments ':feature:__task_list'
_arguments ':feature:__task_list'
esac
;;
esac
......
......@@ -44,24 +44,29 @@ mvn-color()
# aliases
alias mvncie='mvn clean install eclipse:eclipse'
alias mvnci='mvn clean install'
alias mvncist='mvn clean install -DskipTests'
alias mvne='mvn eclipse:eclipse'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvnd='mvn deploy'
alias mvnp='mvn package'
alias mvnc='mvn clean'
alias mvncom='mvn compile'
alias mvnct='mvn clean test'
alias mvnt='mvn test'
alias mvnag='mvn archetype:generate'
alias mvn-updates='mvn versions:display-dependency-updates'
alias mvntc7='mvn tomcat7:run'
alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run'
alias mvndt='mvn dependency:tree'
alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
function listMavenCompletions {
reply=(
# common lifecycle
clean process-resources compile process-test-resources test-compile test package verify install deploy site
clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
# common plugins
deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
......@@ -126,6 +131,10 @@ function listMavenCompletions {
tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
# tomcat7
tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
# tomee
tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
# spring-boot
spring-boot:run spring-boot:repackage
# exec
exec:exec exec:java
# versions
......
# ------------------------------------------------------------------------------
# FILE: n98-magerun.plugin.zsh
# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin
# AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
# n98-magerun basic command completion
_n98_magerun_get_command_list () {
$_comp_command1 --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z\-:]+/ { print $1 }'
}
_n98_magerun () {
_arguments '1: :->command' '*:optional arg:_files'
case $state in
command)
compadd $(_n98_magerun_get_command_list)
;;
*)
esac
}
compdef _n98_magerun n98-magerun.phar
compdef _n98_magerun n98-magerun
# Aliases
alias n98='n98-magerun.phar'
alias mage='n98-magerun.phar'
alias magefl='n98-magerun.phar cache:flush'
# Install n98-magerun into the current directory
alias mage-get='wget https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'
# Nmap aliases plugin
Adds some useful aliases for nmap similar to the profiles in zenmap.
Nmap options are:
* -sS - TCP SYN scan
* -v - verbose
* -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
* -sF - FIN scan (can sneak through non-stateful firewalls)
* -PE - ICMP echo discovery probe
* -PP - timestamp discovery probe
* -PY - SCTP init ping
* -g - use given number as source port
* -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
* -O - enable OS detection
* -sA - TCP ACK scan
* -F - fast scan
* --script=vulscan - also access vulnerabilities in target
## Aliases explained
* nmap_open_ports - scan for open ports on target
* nmap_list_interfaces - list all network interfaces on host where the command runs
* nmap_slow - slow scan that avoids to spam the targets logs
* nmap_fin - scan to see if hosts are up with TCP FIN scan
* nmap_full - aggressive full scan that scans all ports, tries to determine OS and service versions
* nmap_check_for_firewall - TCP ACK scan to check for firewall existence
* nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall
restrictions
* nmap_fast - Fast scan of the top 300 popular ports
* nmap_detect_versions - detects versions of services and OS, runs on all ports
* nmap_check_for_vulns - uses vulscan script to check target services for vulnerabilities
# Some useful nmap aliases for scan modes
# Nmap options are:
# -sS - TCP SYN scan
# -v - verbose
# -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
# -sF - FIN scan (can sneak through non-stateful firewalls)
# -PE - ICMP echo discovery probe
# -PP - timestamp discovery probe
# -PY - SCTP init ping
# -g - use given number as source port
# -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
# -O - enable OS detection
# -sA - TCP ACK scan
# -F - fast scan
# --script=vulscan - also access vulnerabilities in target
alias nmap_open_ports="nmap --open"
alias nmap_list_interfaces="nmap --iflist"
alias nmap_slow="nmap -sS -v -T1"
alias nmap_fin="nmap -sF -v"
alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
alias nmap_ping_through_firewall="nmap -PS -PA"
alias nmap_fast="nmap -F -T5 --top-ports 300"
alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vulscan"
# Open the node api for your current version to the optional section.
# TODO: Make the section part easier to use.
function node-docs {
# get the open command
local open_cmd
if [[ $(uname -s) == 'Darwin' ]]; then
open_cmd='open'
else
open_cmd='xdg-open'
fi
$open_cmd "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
open_command "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1"
}
eval "$(npm completion 2>/dev/null)"
# npm package names are lowercase
# - https://twitter.com/substack/status/23122603153150361
# Thus, we've used camelCase for the following aliases:
# Install and save to dependencies in your package.json
# npms is used by https://www.npmjs.com/package/npms
alias npmS="npm i -S "
# Install and save to dev-dependencies in your package.json
# npmd is used by https://github.com/dominictarr/npmd
alias npmD="npm i -D "
......@@ -35,6 +35,7 @@ EOF
set current_session to current session
tell current_session
write text "${command}"
keystroke return
end tell
end tell
end tell
......@@ -137,23 +138,6 @@ function man-preview() {
man -t "$@" | open -f -a Preview
}
function trash() {
local trash_dir="${HOME}/.Trash"
local temp_ifs=$IFS
IFS=$'\n'
for item in "$@"; do
if [[ -e "$item" ]]; then
item_name="$(basename $item)"
if [[ -e "${trash_dir}/${item_name}" ]]; then
mv -f "$item" "${trash_dir}/${item_name} $(date "+%H-%M-%S")"
else
mv -f "$item" "${trash_dir}/"
fi
fi
done
IFS=$temp_ifs
}
function vncviewer() {
open vnc://$@
}
......@@ -174,12 +158,47 @@ function itunes() {
next|previous)
opt="$opt track"
;;
vol)
opt="set sound volume to $1" #$1 Due to the shift
;;
shuf|shuff|shuffle)
# The shuffle property of current playlist can't be changed in iTunes 12,
# so this workaround uses AppleScript to simulate user input instead.
# Defaults to toggling when no options are given.
# The toggle option depends on the shuffle button being visible in the Now playing area.
# On and off use the menu bar items.
local state=$1
if [[ -n "$state" && ! "$state" =~ "^(on|off|toggle)$" ]]
then
print "Usage: itunes shuffle [on|off|toggle]. Invalid option."
return 1
fi
case "$state" in
on|off)
# Inspired by: http://stackoverflow.com/a/14675583
osascript 1>/dev/null 2>&1 <<-EOF
tell application "System Events" to perform action "AXPress" of (menu item "${state}" of menu "Shuffle" of menu item "Shuffle" of menu "Controls" of menu bar item "Controls" of menu bar 1 of application process "iTunes" )
EOF
return 0
;;
toggle|*)
osascript 1>/dev/null 2>&1 <<-EOF
tell application "System Events" to perform action "AXPress" of (button 2 of process "iTunes"'s window "iTunes"'s scroll area 1)
EOF
return 0
;;
esac
;;
""|-h|--help)
echo "Usage: itunes <option>"
echo "option:"
echo "\tlaunch|play|pause|stop|rewind|resume|quit"
echo "\tmute|unmute\tcontrol volume set"
echo "\tnext|previous\tplay next or previous track"
echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
echo "\tvol\tSet the volume, takes an argument from 0 to 100"
echo "\thelp\tshow this message and exit"
return 0
;;
......@@ -190,4 +209,3 @@ function itunes() {
esac
osascript -e "tell application \"iTunes\" to $opt"
}
#compdef pass
#autoload
# Copyright (C) 2012:
# Copyright (C) 2012 - 2014:
# Johan Venant <jvenant@invicem.pro>
# Brian Mattern <rephorm@rephorm.com>
# Jason A. Donenfeld <Jason@zx2c4.com>.
# Santiago Borrazás <sanbor@gmail.com>
# All Rights Reserved.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
#
# This file is licensed under the GPLv2+.
# Please visit http://git.zx2c4.com/password-store/tree/COPYING for more information.
#
# Oh my zsh plugin maintainer: Santiago Borrazás <sanbor@gmail.com>
_pass () {
......@@ -23,8 +26,8 @@ _pass () {
case "${cmd}" in
init)
_arguments : \
"-r[re-encrypt existing passwords]" \
"--reencrypt[re-encrypt existing passwords]"
"-p[gpg-id will only be applied to this subfolder]" \
"--path[gpg-id will only be applied to this subfolder]"
_pass_complete_keys
;;
ls|list|edit)
......@@ -43,9 +46,19 @@ _pass () {
"-n[don't include symbols in password]" \
"--no-symbols[don't include symbols in password]" \
"-c[copy password to the clipboard]" \
"--clip[copy password to the clipboard]"
"--clip[copy password to the clipboard]" \
"-f[force overwrite]" \
"--force[force overwrite]" \
"-i[replace first line]" \
"--in-place[replace first line]"
_pass_complete_entries_with_subdirs
;;
cp|copy|mv|rename)
_arguments : \
"-f[force rename]" \
"--force[force rename]"
_pass_complete_entries_with_subdirs
;;
rm)
_arguments : \
"-f[force deletion]" \
......@@ -75,10 +88,14 @@ _pass () {
subcommands=(
"init:Initialize new password storage"
"ls:List passwords"
"find:Find password files or directories based on pattern"
"grep:Search inside decrypted password files for matching pattern"
"show:Decrypt and print a password"
"insert:Insert a new password"
"generate:Generate a new password using pwgen"
"edit:Edit a password with \$EDITOR"
"mv:Rename the password"
"cp:Copy the password"
"rm:Remove the password"
"git:Call git on the password store"
"version:Output version information"
......@@ -101,7 +118,7 @@ _pass_cmd_show () {
_pass_complete_entries_helper () {
local IFS=$'\n'
local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
_values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort)
_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' | sort):-""}
}
_pass_complete_entries_with_subdirs () {
......@@ -117,3 +134,5 @@ _pass_complete_keys () {
# Extract names and email addresses from gpg --list-keys
_values 'gpg keys' $(gpg2 --list-secret-keys --with-colons | cut -d : -f 10 | sort -u | sed '/^$/d')
}
_pass
_paver_does_target_list_need_generating () {
[ ! -f .paver_targets ] && return 0;
[ pavement.py -nt .paver_targets ] && return 0;
return 1;
}
_paver () {
if [ -f pavement.py ]; then
if _paver_does_target_list_need_generating; then
paver --help 2>&1 |grep '-'|grep -v -e '--'|awk -F '-' '{print $1}'|tr -d ' ' > .paver_targets
fi
compadd `cat .paver_targets`
fi
}
compdef _paver paver
......@@ -27,7 +27,7 @@ alias latest-perl='curl -s http://www.perl.org/get.html | perl -wlne '\''if (/pe
# Functions #################################################################
# newpl - creates a basic Perl script file and opens it with $EDITOR
# newpl - creates a basic Perl script file and opens it with $EDITOR
newpl () {
# set $EDITOR to 'vim' if it is undefined
[[ -z $EDITOR ]] && EDITOR=vim
......@@ -54,9 +54,3 @@ pgs() { # [find] [replace] [filename]
prep() { # [pattern] [filename unless STDOUT]
perl -nle 'print if /'"$1"'/;' $2
}
# say - append a newline to 'print'
say() {
print "$1\n"
}
_phing_does_target_list_need_generating () {
[ ! -f .phing_targets ] && return 0;
[ .phing_targets -nt build.xml ] && return 0;
[ build.xml -nt .phing_targets ] && return 0;
return 1;
}
_phing () {
if [ -f build.xml ]; then
if _phing_does_target_list_need_generating; then
phing -l |grep -v ":$" |grep -v "^-*$" > .phing_targets
phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}' > .phing_targets
fi
compadd `cat .phing_targets`
fi
......
#compdef pip
#compdef pip pip2 pip-2.7 pip3 pip-3.2 pip-3.3 pip-3.4
#autoload
# pip zsh completion, based on homebrew completion
......
......@@ -18,8 +18,11 @@ function pj() {
file=$1
if [[ "open" == "$file" ]] then
file=$2
shift
file=$*
cmd=(${(s: :)EDITOR})
else
file=$*
fi
for project in $PROJECT_PATHS; do
......@@ -36,7 +39,11 @@ function pj() {
alias pjo="pj open"
function _pj () {
compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $9 }'`
# might be possible to improve this using glob, without the basename trick
typeset -a projects
projects=($PROJECT_PATHS/*)
projects=$projects:t
_arguments "*:file:($projects)"
}
compdef _pj pj
#compdef pod
#autoload
# setopt XTRACE VERBOSE
# vim: ft=zsh sw=2 ts=2 et
# -----------------------------------------------------------------------------
# FILE: _pod
# DESCRIPTION: Cocoapods (0.27.1) autocomplete plugin for Oh-My-Zsh
# DESCRIPTION: Cocoapods (0.33.1) autocomplete plugin for Oh-My-Zsh
# http://cocoapods.org
# Generated with `pod --completion-script
# AUTHOR: Alexandre Joly (alexandre.joly@mekanics.ch)
# GITHUB: https://github.com/mekanics
# TWITTER: @jolyAlexandre
# VERSION: 0.0.3
# LICENSE: MIT
# VERSION: 0.0.5
# -----------------------------------------------------------------------------
local -a _1st_arguments
_1st_arguments=(
'help:Show help for the given command'
'init:Generate a Podfile for the current directory'
'install:Install project dependencies'
'ipc:Inter-process communication'
'list:List pods'
'outdated:Show outdated project dependencies'
'podfile-info:Shows information on installed Pods'
'push:Push new specifications to a spec-repo'
'repo:Manage spec-repositories'
'search:Searches for pods'
'setup:Setup the CocoaPods environment'
'spec:Manage pod specs'
'update:Update outdated project dependencies'
)
local -a _repo_arguments
_repo_arguments=(
'add:Add a spec repo'
'lint:Validates all specs in a repo'
'remove:Remove a spec repo.'
'update:Update a spec repo'
)
local -a _spec_arguments
_spec_arguments=(
'cat:Prints a spec file'
'create:Create spec file stub'
'edit:Edit a spec file'
'lint:Validates a spec file'
'which:Prints the path of the given spec'
)
local -a _ipc_arguments
_ipc_arguments=(
'list:Lists the specifications know to CocoaPods'
'podfile:Converts a Podfile to YAML'
'repl:The repl listens to commands on standard input'
'spec:Converts a podspec to YAML'
'update-search-index:Updates the search index'
)
local -a _list_arguments
_list_arguments=(
'new:Lists pods introduced in the master spec-repo since the last check'
)
local -a _inherited_options
_inherited_options=(
'(--silent)--silent[Show nothing]' \
'(--version)--version[Show the version of CocoaPods]' \
'(--no-color)--no-color[Show output without color]' \
'(--verbose)--verbose[Show more debugging information]' \
'(--help)--help[Show help banner of specified command]'
)
local -a _install_options
_install_options=(
'(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn` intact after downloading]' \
'(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \
'(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]'
)
local -a _update_options
_update_options=(
'(--no-clean)--no-clean[Leave SCM dirs like `.git` and `.svn intact after downloading]' \
'(--no-integrate)--no-integrate[Skip integration of the Pods libraries in the Xcode project(s)]' \
'(--no-repo-update)--no-repo-update[Skip running `pod repo update before install]'
)
local -a _outdated_options
_outdated_options=(
'(--no-repo-update)--no-repo-update[Skip running `pod repo update` before install]'
)
local -a _search_options
_search_options=(
'(--full)--full[Search by name, summary, and description]' \
'(--stats)--stats[Show additional stats (like GitHub watchers and forks)]' \
'(--ios)--ios[Restricts the search to Pods supported on iOS]' \
'(--osx)--osx[Restricts the search to Pods supported on OS X]'
)
local -a _list_options
_list_options=(
'(--update)--update[Run `pod repo update` before listing]'
)
local -a _podfile_info_options
_podfile_info_options=(
'(--all)--all[Show information about all Pods with dependencies that are used in a project]' \
'(--md)--md[Output information in Markdown format]' \
'*:script or directory:_files'
)
local -a _push_options
_push_options=(
'(--allow-warnings)--allow-warnings[Allows pushing even if there are warnings]' \
'(--local-only)--local-only[Does not perform the step of pushing REPO to its remote]' \
'*:script or directory:_files'
)
local -a _repo_lint_options
_repo_lint_options=(
'(--only-errors)--only-errors[Lint presents only the errors]'
)
local -a _setup_options
_setup_options=(
'(--push)--push[Use this option to enable push access once granted]'
)
local -a _spec_lint_options
_spec_lint_options=(
'(--quick)--quick[Lint skips checks that would require to download and build the spec]' \
'(--only-errors)--only-errors[Lint validates even if warnings are present]' \
'(--no-clean)--no-clean[Lint leaves the build directory intact for inspection]' \
'*:script or directory:_files'
)
local -a _spec_cat_options
_spec_cat_options=(
'(--show-all)--show-all[Pick from all versions of the given podspec]'
)
local -a _spec_which_options
_spec_which_options=(
'(--show-all)--show-all[Print all versions of the given podspec]'
)
local -a _spec_edit_options
_spec_edit_options=(
'(--show-all)--show-all[Pick which spec to edit from all available versions of the given podspec]'
)
__first_command_list ()
{
local expl
declare -a tasks
tasks=(install ipc list outdated podfile-info push repo search setup spec update)
_wanted tasks expl 'help' compadd $tasks
}
__repo_list() {
_wanted application expl 'repo' compadd $(command ls -1 ~/.cocoapods/repos 2>/dev/null | sed -e 's/ /\\ /g')
}
__pod-repo() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "pod repo" _repo_arguments
return
;;
(options)
case $line[1] in
(lint)
_arguments \
$_inherited_options \
$_repo_lint_options \
':feature:__repo_list'
;;
(update)
_arguments \
$_inherited_options \
':feature:__repo_list'
;;
(add)
_arguments \
$_inherited_options
(remove)
_arguments \
$_inherited_options \
':feature:__repo_list'
;;
esac
;;
local -a _subcommands
local -a _options
case "$words[2]" in
help)
case "$words[3]" in
*) # pod help
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod help options" _options
;;
esac
}
__pod-spec() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "pod spec" _spec_arguments
return
;;
(options)
case $line[1] in
(create)
_arguments \
$_inherited_options
;;
(lint)
_arguments \
$_inherited_options \
$_spec_lint_options
;;
(cat)
_arguments \
$_inherited_options \
$_spec_cat_options
;;
(which)
_arguments \
$_inherited_options \
$_spec_which_options
;;
(edit)
_arguments \
$_inherited_options \
$_spec_edit_options
;;
esac
return
;;
;;
ipc)
case "$words[3]" in
list)
case "$words[4]" in
*) # pod ipc list
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc list options" _options
;;
esac
;;
podfile)
case "$words[4]" in
*) # pod ipc podfile
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc podfile options" _options
;;
esac
;;
repl)
case "$words[4]" in
*) # pod ipc repl
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc repl options" _options
;;
esac
;;
spec)
case "$words[4]" in
*) # pod ipc spec
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc spec options" _options
;;
esac
;;
update-search-index)
case "$words[4]" in
*) # pod ipc update-search-index
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc update-search-index options" _options
;;
esac
;;
*) # pod ipc
_subcommands=(
"list:Lists the specifications known to CocoaPods."
"podfile:Converts a Podfile to YAML."
"repl:The repl listens to commands on standard input."
"spec:Converts a podspec to JSON."
"update-search-index:Updates the search index."
)
_describe -t commands "pod ipc subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod ipc options" _options
;;
esac
}
__pod-ipc() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "pod ipc" _ipc_arguments
return
;;
(options)
_arguments -C \
$_inherited_options
return
;;
;;
init)
case "$words[3]" in
*) # pod init
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod init options" _options
;;
esac
}
__pod-list() {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
$_inherited_options \
$_list_options \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "pod list" _list_arguments
return
;;
(options)
_arguments -C \
$_inherited_options \
$_list_options
return
;;
;;
install)
case "$words[3]" in
*) # pod install
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-clean:Leave SCM dirs like \`.git\` and \`.svn\` intact after downloading"
"--no-integrate:Skip integration of the Pods libraries in the Xcode project(s)"
"--no-repo-update:Skip running \`pod repo update\` before install"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod install options" _options
;;
esac
}
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
$_inherited_options \
':command:->command' \
'*::options:->options'
case $state in
(command)
_describe -t commands "pod" _1st_arguments
return
;;
(options)
case $line[1] in
(help)
_arguments \
$_inherited_options \
':help:__first_command_list'
;;
(push)
_arguments \
$_inherited_options \
$_push_options \
':repo:__repo_list'
;;
(repo)
__pod-repo
;;
(spec)
__pod-spec
;;
(ipc)
__pod-ipc
;;
(list)
__pod-list
;;
(install)
_arguments \
$_inherited_options \
$_install_options
;;
(update)
_arguments \
$_inherited_options \
$_update_options
;;
(outdated)
_arguments \
$_inherited_options \
$_outdated_options
;;
(search)
_arguments \
$_inherited_options \
$_search_options
;;
(podfile-info)
_arguments \
$_inherited_options \
$_podfile_info_options
;;
(setup)
_arguments \
$_inherited_options \
$_setup_options
;;
lib)
case "$words[3]" in
create)
case "$words[4]" in
*) # pod lib create
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod lib create options" _options
;;
esac
;;
lint)
case "$words[4]" in
*) # pod lib lint
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-clean:Lint leaves the build directory intact for inspection"
"--no-subspecs:Lint skips validation of subspecs"
"--only-errors:Lint validates even if warnings are present"
"--quick:Lint skips checks that would require to download and build the spec"
"--silent:Show nothing"
"--subspec=NAME:Lint validates only the given subspec"
"--verbose:Show more debugging information"
)
_describe -t options "pod lib lint options" _options
;;
esac
;;
*) # pod lib
_subcommands=(
"create:Creates a new Pod"
"lint:Validates a Pod"
)
_describe -t commands "pod lib subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod lib options" _options
;;
esac
;;
list)
case "$words[3]" in
new)
case "$words[4]" in
*) # pod list new
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--update:Run \`pod repo update\` before listing"
"--verbose:Show more debugging information"
)
_describe -t options "pod list new options" _options
;;
esac
;;
*) # pod list
_subcommands=(
"new:Lists pods introduced in the master spec-repo since the last check"
)
_describe -t commands "pod list subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--update:Run \`pod repo update\` before listing"
"--verbose:Show more debugging information"
)
_describe -t options "pod list options" _options
;;
esac
;;
outdated)
case "$words[3]" in
*) # pod outdated
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-repo-update:Skip running \`pod repo update\` before install"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod outdated options" _options
;;
esac
;;
plugins)
case "$words[3]" in
create)
case "$words[4]" in
*) # pod plugins create
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins create options" _options
;;
esac
;;
list)
case "$words[4]" in
*) # pod plugins list
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins list options" _options
;;
esac
;;
search)
case "$words[4]" in
*) # pod plugins search
_options=(
"--full:Search by name, author, and description"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins search options" _options
;;
esac
;;
*) # pod plugins
_subcommands=(
"create:Creates a new plugin"
"list:List all known plugins"
"search:Search for known plugins"
)
_describe -t commands "pod plugins subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod plugins options" _options
;;
esac
;;
push)
case "$words[3]" in
*) # pod push
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod push options" _options
;;
esac
;;
repo)
case "$words[3]" in
add)
case "$words[4]" in
*) # pod repo add
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--shallow:Create a shallow clone (fast clone, but no push capabilities)"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo add options" _options
;;
esac
;;
lint)
case "$words[4]" in
*) # pod repo lint
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--only-errors:Lint presents only the errors"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo lint options" _options
;;
esac
;;
push)
case "$words[4]" in
*) # pod repo push
_options=(
"--allow-warnings:Allows pushing even if there are warnings"
"--help:Show help banner of specified command"
"--local-only:Does not perform the step of pushing REPO to its remote"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo push options" _options
;;
esac
;;
remove)
case "$words[4]" in
*) # pod repo remove
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo remove options" _options
;;
esac
;;
update)
case "$words[4]" in
*) # pod repo update
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo update options" _options
;;
esac
;;
*) # pod repo
_subcommands=(
"add:Add a spec repo."
"lint:Validates all specs in a repo."
"push:Push new specifications to a spec-repo"
"remove:Remove a spec repo"
"update:Update a spec repo."
)
_describe -t commands "pod repo subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod repo options" _options
;;
esac
;;
search)
case "$words[3]" in
*) # pod search
_options=(
"--full:Search by name, summary, and description"
"--help:Show help banner of specified command"
"--ios:Restricts the search to Pods supported on iOS"
"--no-ansi:Show output without ANSI codes"
"--osx:Restricts the search to Pods supported on OS X"
"--stats:Show additional stats (like GitHub watchers and forks)"
"--verbose:Show more debugging information"
"--web:Searches on cocoapods.org"
)
_describe -t options "pod search options" _options
;;
esac
;;
setup)
case "$words[3]" in
*) # pod setup
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-shallow:Clone full history so push will work"
"--push:Use this option to enable push access once granted"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod setup options" _options
;;
esac
;;
spec)
case "$words[3]" in
cat)
case "$words[4]" in
*) # pod spec cat
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--show-all:Pick from all versions of the given podspec"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec cat options" _options
;;
esac
;;
create)
case "$words[4]" in
*) # pod spec create
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec create options" _options
;;
esac
;;
edit)
case "$words[4]" in
*) # pod spec edit
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--show-all:Pick which spec to edit from all available versions of the given podspec"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec edit options" _options
;;
esac
;;
lint)
case "$words[4]" in
*) # pod spec lint
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-clean:Lint leaves the build directory intact for inspection"
"--no-subspecs:Lint skips validation of subspecs"
"--only-errors:Lint validates even if warnings are present"
"--quick:Lint skips checks that would require to download and build the spec"
"--silent:Show nothing"
"--subspec=NAME:Lint validates only the given subspec"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec lint options" _options
;;
esac
;;
which)
case "$words[4]" in
*) # pod spec which
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--show-all:Print all versions of the given podspec"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec which options" _options
;;
esac
;;
*) # pod spec
_subcommands=(
"cat:Prints a spec file."
"create:Create spec file stub."
"edit:Edit a spec file."
"lint:Validates a spec file."
"which:Prints the path of the given spec."
)
_describe -t commands "pod spec subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod spec options" _options
;;
esac
;;
trunk)
case "$words[3]" in
add-owner)
case "$words[4]" in
*) # pod trunk add-owner
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk add-owner options" _options
;;
esac
;;
me)
case "$words[4]" in
clean-sessions)
case "$words[5]" in
*) # pod trunk me clean-sessions
_options=(
"--all:Removes all your sessions, except for the current one"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk me clean-sessions options" _options
;;
esac
;;
*) # pod trunk me
_subcommands=(
"clean-sessions:Remove sessions"
)
_describe -t commands "pod trunk me subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk me options" _options
;;
esac
;;
push)
case "$words[4]" in
*) # pod trunk push
_options=(
"--allow-warnings:Allows push even if there are lint warnings"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk push options" _options
;;
esac
;;
register)
case "$words[4]" in
*) # pod trunk register
_options=(
"--description=DESCRIPTION:An arbitrary description to easily identify your session later on."
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk register options" _options
;;
esac
;;
*) # pod trunk
_subcommands=(
"add-owner:Add an owner to a pod"
"me:Display information about your sessions"
"push:Publish a podspec"
"register:Manage sessions"
)
_describe -t commands "pod trunk subcommands" _subcommands
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod trunk options" _options
;;
esac
;;
try)
case "$words[3]" in
*) # pod try
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod try options" _options
;;
esac
;;
update)
case "$words[3]" in
*) # pod update
_options=(
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--no-clean:Leave SCM dirs like \`.git\` and \`.svn\` intact after downloading"
"--no-integrate:Skip integration of the Pods libraries in the Xcode project(s)"
"--no-repo-update:Skip running \`pod repo update\` before install"
"--silent:Show nothing"
"--verbose:Show more debugging information"
)
_describe -t options "pod update options" _options
;;
esac
;;
*) # pod
_subcommands=(
"help:Show help for the given command."
"ipc:Inter-process communication"
"init:Generate a Podfile for the current directory."
"install:Install project dependencies"
"lib:Develop pods"
"list:List pods"
"outdated:Show outdated project dependencies"
"plugins:Show available CocoaPods plugins"
"push:Temporary alias for the \`pod repo push\` command"
"repo:Manage spec-repositories"
"search:Searches for pods"
"setup:Setup the CocoaPods environment"
"spec:Manage pod specs"
"trunk:Interact with the CocoaPods API (e.g. publishing new specs)"
"try:Try a Pod!"
"update:Update outdated project dependencies"
)
_describe -t commands "pod subcommands" _subcommands
_options=(
"--completion-script:Print the auto-completion script"
"--help:Show help banner of specified command"
"--no-ansi:Show output without ANSI codes"
"--silent:Show nothing"
"--verbose:Show more debugging information"
"--version:Show the version of the tool"
)
_describe -t options "pod options" _options
;;
esac
# Aliases to stop, start and restart Postgres
# Paths noted below are for Postgress installed via Homebrew on OSX
# Aliases to control Postgres
# Paths noted below are for Postgres installed via Homebrew on OSX
alias startpost='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias stoppost='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
alias restartpost='stoppost && sleep 1 && startpost'
\ No newline at end of file
alias restartpost='stoppost && sleep 1 && startpost'
alias reloadpost='pg_ctl reload -D /usr/local/var/postgres -s'
alias statuspost='pg_ctl status -D /usr/local/var/postgres -s'
\ No newline at end of file
......@@ -21,13 +21,13 @@
rack_root(){
setopt chaselinks
local orgdir="$(pwd)"
local basedir="$(pwd)"
local orgdir="$PWD"
local basedir="$PWD"
while [[ $basedir != '/' ]]; do
test -e "$basedir/config.ru" && break
builtin cd ".." 2>/dev/null
basedir="$(pwd)"
basedir="$PWD"
done
builtin cd "$orgdir" 2>/dev/null
......@@ -56,7 +56,7 @@ kapow(){
compctl -W ~/.pow -/ kapow
powit(){
local basedir="$(pwd)"
local basedir="$PWD"
local vhost=$1
[ ! -n "$vhost" ] && vhost=$(rack_root_detect)
if [ ! -h ~/.pow/$vhost ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment