d51ee38906c1b61437920bcb7ddcb662b9cae006
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/ng/README.md b/plugins/ng/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..86ad64041284fd29f7fcb34d4af0dfb59c0b1b7a
4--- /dev/null
5+++ b/plugins/ng/README.md
6@@ -0,0 +1,37 @@
7+## NG Plugin
8+
9+This [ng plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/ng)
10+ adds completion support for Angular's CLI (named ng).
11+
12+Ng is hosted on [ng home](https://github.com/catull/angular-cli)
13+
14+It is used to generate Angular 2 app "stubs", build those apps, configure them,
15+test them, lint them etc.
16+
17+Ahem, "stubs" is not what Angular engineers refer to the items ng can generate
18+for you.
19+
20+"Stubs" can be any one of:
21+- class
22+- component
23+- directive
24+- enum
25+- module
26+- pipe
27+- route
28+- service
29+
30+At the moment, `ng completion` creates a very rough completion for Zsh and
31+Bash.
32+
33+It is missing most of the options and a few arguments.
34+In future, this plugin may be shortened to simply being
35+
36+```zsh
37+eval `ng completion`
38+```
39+
40+There is hope this materialises in the 21st century.
41+
42+### CONTRIBUTOR
43+ - Carlo Dapor ([catull](https://github.com/catull))
44diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh
45new file mode 100644
46index 0000000000000000000000000000000000000000..2488bc230fa40d011827f1510332f980619bc263
47--- /dev/null
48+++ b/plugins/ng/ng.plugin.zsh
49@@ -0,0 +1,77 @@
50+
51+ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help'
52+
53+_ng_completion () {
54+ local words cword opts
55+ read -Ac words
56+ read -cn cword
57+ let cword-=1
58+
59+ case $words[cword] in
60+ addon )
61+ opts='-b --blueprint -d -dir --directory --dry-run -sb --skip-bower -sg --skip-git -sn --skip-npm -v --verbose'
62+ ;;
63+
64+ asset-sizes )
65+ opts='-o --output-path'
66+ ;;
67+
68+ b | build )
69+ opts='--environment --output-path --suppress-sizes --target --watch --watcher -dev -e -prod'
70+ ;;
71+
72+ d | destroy )
73+ opts='--dry-run --verbose --pod --classic --dummy --in-repo --in-repo-addon -d -v -p -c -dum -id -ir'
74+ ;;
75+
76+ g | generate )
77+ opts='class component directive enum module pipe route service --generate -d --dry-run --verbose -v --pod -p --classic -c --dummy -dum -id --in-repo --in-repo-addon -ir'
78+ ;;
79+
80+ gh-pages:deploy | github-pages:deploy )
81+ opts='--environment --gh-token --gh-username --skip-build --user-page --message'
82+ ;;
83+
84+ h | help | -h | --help)
85+ opts='--json --verbose -v'
86+ ;;
87+
88+ init )
89+ opts='--blueprint --dry-run --link-cli --mobile --name --prefix --skip-bower --skip-npm --source-dir --style --verbose -b -d -lc -n -p -sb -sd -sn -v'
90+ ;;
91+
92+ new )
93+ opts='--blueprint --directory --dry-run --link-cli --mobile --prefix --skip-bower --skip-git --skip-npm --source-dir --style --verbose -b -d -dir -lc -p -sb -sd -sg -sn -v'
94+ ;;
95+
96+ s | serve | server )