Created
July 17, 2014 18:56
-
-
Save WMeldon/19e822d30a57f48c36cd to your computer and use it in GitHub Desktop.
Ember command completion for (oh-my) ZSH.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------------ | |
# 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