Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ember command completion for (oh-my) ZSH.
# ------------------------------------------------------------------------------
# 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