Commit 2595484a authored by Sébastien M-B's avatar Sébastien M-B
Browse files

Merge remote-tracking branch 'upstream/master'

Conflicts:
	lib/aliases.zsh
parents 8d23a361 6e6cf430
The MIT License
Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
...@@ -26,17 +26,20 @@ h3. The manual way ...@@ -26,17 +26,20 @@ h3. The manual way
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@ @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
2. Create a new zsh config by copying the zsh template we've provided. 2. *OPTIONAL* Backup your existing ~/.zshrc file
*NOTE*: If you already have a ~/.zshrc file, you should back it up. @cp ~/.zshrc ~/.zshrc.orig@ in case you want to go back to your original settings. @cp ~/.zshrc ~/.zshrc.orig@
3. Create a new zsh config by copying the zsh template we've provided.
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@ @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
3. Set zsh as your default shell:
4. Set zsh as your default shell:
@chsh -s /bin/zsh@ @chsh -s /bin/zsh@
4. Start / restart zsh (open a new terminal is easy enough...) 5. Start / restart zsh (open a new terminal is easy enough...)
h3. Problems? h3. Problems?
......
...@@ -8,6 +8,7 @@ alias -- -='cd -' ...@@ -8,6 +8,7 @@ alias -- -='cd -'
# Super user # Super user
alias _='sudo' alias _='sudo'
alias please='sudo'
#alias g='grep -in' #alias g='grep -in'
...@@ -18,6 +19,7 @@ alias history='fc -l 1' ...@@ -18,6 +19,7 @@ alias history='fc -l 1'
alias lsa='ls -lah' alias lsa='ls -lah'
#alias l='ls -la' #alias l='ls -la'
alias ll='ls -l' alias ll='ls -l'
alias la='ls -lA'
alias sl=ls # often screw this up alias sl=ls # often screw this up
alias afind='ack-grep -il' alias afind='ack-grep -il'
......
...@@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir ...@@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
cdpath=(.) cdpath=(.)
# use /etc/hosts and known_hosts for hostname completion # use /etc/hosts and known_hosts for hostname completion
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=() [ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
......
...@@ -26,9 +26,9 @@ cd () { ...@@ -26,9 +26,9 @@ cd () {
elif [[ "x$*" == "x...." ]]; then elif [[ "x$*" == "x...." ]]; then
cd ../../.. cd ../../..
elif [[ "x$*" == "x....." ]]; then elif [[ "x$*" == "x....." ]]; then
cd ../../..
elif [[ "x$*" == "x......" ]]; then
cd ../../../.. cd ../../../..
elif [[ "x$*" == "x......" ]]; then
cd ../../../../..
else else
builtin cd "$@" builtin cd "$@"
fi fi
...@@ -37,8 +37,3 @@ cd () { ...@@ -37,8 +37,3 @@ cd () {
alias md='mkdir -p' alias md='mkdir -p'
alias rd=rmdir alias rd=rmdir
alias d='dirs -v | head -10' alias d='dirs -v | head -10'
# mkdir & cd to it
function mcd() {
mkdir -p "$1" && cd "$1";
}
function zsh_stats() { function zsh_stats() {
history | awk '{print $2}' | sort | uniq -c | sort -rn | head history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
} }
function uninstall_oh_my_zsh() { function uninstall_oh_my_zsh() {
......
# get the name of the branch we are on # get the name of the branch we are on
function git_prompt_info() { function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
} }
...@@ -8,6 +9,7 @@ function git_prompt_info() { ...@@ -8,6 +9,7 @@ function git_prompt_info() {
# Checks if working tree is dirty # Checks if working tree is dirty
parse_git_dirty() { parse_git_dirty() {
local SUBMODULE_SYNTAX='' local SUBMODULE_SYNTAX=''
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then if [[ $POST_1_7_2_GIT -gt 0 ]]; then
SUBMODULE_SYNTAX="--ignore-submodules=dirty" SUBMODULE_SYNTAX="--ignore-submodules=dirty"
fi fi
...@@ -16,8 +18,28 @@ parse_git_dirty() { ...@@ -16,8 +18,28 @@ parse_git_dirty() {
else else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN" echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi fi
fi
} }
# get the difference between the local and remote branches
git_remote_status() {
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]] ; then
ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
then
echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
fi
fi
}
# Checks if there are commits ahead from remote # Checks if there are commits ahead from remote
function git_prompt_ahead() { function git_prompt_ahead() {
...@@ -38,7 +60,7 @@ function git_prompt_long_sha() { ...@@ -38,7 +60,7 @@ function git_prompt_long_sha() {
# Get the status of the working tree # Get the status of the working tree
git_prompt_status() { git_prompt_status() {
INDEX=$(git status --porcelain 2> /dev/null) INDEX=$(git status --porcelain -b 2> /dev/null)
STATUS="" STATUS=""
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
...@@ -60,12 +82,26 @@ git_prompt_status() { ...@@ -60,12 +82,26 @@ git_prompt_status() {
fi fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi fi
if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi fi
if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS echo $STATUS
} }
......
...@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word ...@@ -9,5 +9,7 @@ bindkey "^[m" copy-prev-shell-word
setopt long_list_jobs setopt long_list_jobs
## pager ## pager
export PAGER="less -R" export PAGER="less"
export LESS="-R"
export LC_CTYPE=$LANG export LC_CTYPE=$LANG
# get the name of the branch we are on # get the name of the ruby version
function rvm_prompt_info() { function rvm_prompt_info() {
ruby_version=$(~/.rvm/bin/rvm-prompt 2> /dev/null) || return [ -f $HOME/.rvm/bin/rvm-prompt ] || return
echo "($ruby_version)" local rvm_prompt
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
[[ "${rvm_prompt}x" == "x" ]] && return
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
} }
...@@ -26,8 +26,8 @@ function omz_termsupport_precmd { ...@@ -26,8 +26,8 @@ function omz_termsupport_precmd {
function omz_termsupport_preexec { function omz_termsupport_preexec {
emulate -L zsh emulate -L zsh
setopt extended_glob setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
title "$CMD" "%100>...>$2%<<" title "$CMD" "%100>...>${2:gs/%/%%}%<<"
} }
autoload -U add-zsh-hook autoload -U add-zsh-hook
......
...@@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath) ...@@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all of the config files in ~/oh-my-zsh that end in .zsh # Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore # TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh) source $config_file for config_file ($ZSH/lib/*.zsh); do
source $config_file
done
# Set ZSH_CUSTOM to the path where your custom config files # Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/ # and plugins exists, or else we will use the default custom/
...@@ -51,7 +53,10 @@ for plugin ($plugins); do ...@@ -51,7 +53,10 @@ for plugin ($plugins); do
done done
# Load all of your custom configurations from custom/ # Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file for config_file ($ZSH_CUSTOM/*.zsh(N)); do
source $config_file
done
unset config_file
# Load the theme # Load the theme
if [ "$ZSH_THEME" = "random" ] if [ "$ZSH_THEME" = "random" ]
......
...@@ -75,3 +75,19 @@ pacdisowned() { ...@@ -75,3 +75,19 @@ pacdisowned() {
comm -23 "$fs" "$db" comm -23 "$fs" "$db"
} }
pacmanallkeys() {
# Get all keys for developers and trusted users
curl https://www.archlinux.org/{developers,trustedusers}/ |
awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
xargs sudo pacman-key --recv-keys
}
pacmansignkeys() {
for key in $*; do
sudo pacman-key --recv-keys $key
sudo pacman-key --lsign-key $key
printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
--no-permission-warning --command-fd 0 --edit-key $key
done
}
...@@ -3,7 +3,11 @@ if [ $commands[autojump] ]; then # check if autojump is installed ...@@ -3,7 +3,11 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. /usr/share/autojump/autojump.zsh . /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh . /etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
. `brew --prefix`/etc/autojump . $HOME/.autojump/etc/profile.d/autojump.zsh
elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
. /opt/local/etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
. `brew --prefix`/etc/autojump.zsh
fi fi
fi fi
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then ###########################################
# Battery plugin for oh-my-zsh #
# Original Author: Peter hoeg (peterhoeg) #
# Email: peter@speartail.com #
###########################################
# Author: Sean Jones (neuralsandwich) #
# Email: neuralsandwich@gmail.com #
# Modified to add support for Apple Mac #
###########################################
if [[ $(uname) == "Darwin" ]] ; then
function battery_pct_remaining() {
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
integer i=$(((currentcapacity/maxcapacity) * 100))
echo $i
else
echo "External Power"
fi
}
function battery_time_remaining() {
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
echo "~$((timeremaining / 60)):$((timeremaining % 60))"
else
echo "∞"
fi
}
function battery_pct_prompt () {
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
b=$(battery_pct_remaining)
if [ $b -gt 50 ] ; then
color='green'
elif [ $b -gt 20 ] ; then
color='yellow'
else
color='red'
fi
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
else
echo ""
fi
}
elif [[ $(uname) == "Linux" ]] ; then
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" } function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') } function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
function battery_pct_prompt() { function battery_pct_prompt() {
...@@ -12,9 +62,10 @@ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then ...@@ -12,9 +62,10 @@ if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
fi fi
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
} }
else else
error_msg='no battery' error_msg='no battery'
function battery_pct_remaining() { echo $error_msg } function battery_pct_remaining() { echo $error_msg }
function battery_time_remaining() { echo $error_msg } function battery_time_remaining() { echo $error_msg }
function battery_pct_prompt() { echo '' } function battery_pct_prompt() { echo '' }
fi
fi fi
...@@ -6,7 +6,7 @@ alias bu="bundle update" ...@@ -6,7 +6,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec # The following is based on https://github.com/gma/bundler-exec
bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails) bundled_commands=(annotate cap capify cucumber foreman guard middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails puma zeus)
## Functions ## Functions
...@@ -33,6 +33,7 @@ _run-with-bundler() { ...@@ -33,6 +33,7 @@ _run-with-bundler() {
## Main program ## Main program
for cmd in $bundled_commands; do for cmd in $bundled_commands; do
eval "function unbundled_$cmd () { $cmd \$@ }"
eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}" eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
alias $cmd=bundled_$cmd alias $cmd=bundled_$cmd
......
#
# Requires http://www.bruji.com/bwana/
#
if [[ -e /Applications/Bwana.app ]] ||
( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
then
function man() {
open "man:$1"
}
else
echo "Bwana lets you read man files in Safari through a man: URI scheme"
echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
fi
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
}
function _cap () {
if [ -f config/deploy.rb ]; then
if _cap_does_task_list_need_generating; then
echo "\nGenerating .cap_tasks~..." > /dev/stderr
cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D'
> .cap_tasks~
fi
compadd `cat .cap_tasks~`
fi
}
compctl -K _cap cap
#compdef cap
#autoload
if [ -f config/deploy.rb ]; then
if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
echo "\nGenerating .cap_tasks~..." > /dev/stderr
cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
fi
compadd `cat .cap_tasks~`
fi
#compdef coffee
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Mario Fernandez (https://github.com/sirech)
#
# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments -C \
'(- *)'{-h,--help}'[display this help message]' \
'(- *)'{-v,--version}'[display the version number]' \
'(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
'(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
'(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
'(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
'(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
'(--nodejs)--nodejs[pass options directly to the "node" binary]' \
'(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
'(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
'(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
'(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
'(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
'(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
'(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
'(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
'*:script or directory:_files' && ret=0
return ret
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et
n forw-line
e back-line
k repeat-search
\ek repeat-search-all
K reverse-search
\eK reverse-search-all
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