Skip to content

Instantly share code, notes, and snippets.

@georgkreimer
Forked from WMeldon/ember.plugin.zsh
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgkreimer/e567516c36840d1988ce to your computer and use it in GitHub Desktop.
Save georgkreimer/e567516c36840d1988ce to your computer and use it in GitHub Desktop.
# ------------------------------------------------------------------------------
# FILE: ember.plugin.zsh
# DESCRIPTION: oh-my-zsh ember plugin file.
# AUTHOR: Will Meldon (wdmeldon@gmail.com)
# 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