Skip to content

Instantly share code, notes, and snippets.

@kimroen
Forked from WMeldon/ember.plugin.zsh
Created July 18, 2014 07:45
Show Gist options
  • Save kimroen/f2d15e97976e52f45796 to your computer and use it in GitHub Desktop.
Save kimroen/f2d15e97976e52f45796 to your computer and use it in GitHub Desktop.
# ------------------------------------------------------------------------------
# FILE: ember.plugin.zsh
# DESCRIPTION: oh-my-zsh ember plugin file.
# AUTHOR: Will Meldon ([email protected])
# VERSION: 0.0.1
# ------------------------------------------------------------------------------
# Based (heavily) on composer.plugin.zsh
#
# Ember basic command completion
_ember_get_command_list () {
ember | sed "1,/Available commands/d" | awk '/^ember [a-z]+/ { print $2 }'
}
_ember () {
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments \
'1: :->command'\
'*: :->args'
if [ -f .ember-cli ]; then
compadd `_ember_get_command_list`
else
compadd help init new update version
fi
}
compdef _ember ember
alias em='ember'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment