eea77b7cb7a8d64a03d7eddc5e0f05e122b82546

Author
Will Mendes <willmendesneto@gmail.com>
Committer
Will Mendes <willmendesneto@gmail.com>
Date

Message

Add stackoverflow link

Diff

 1diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
 2index 32784d03b9eec6bd754068728ee117fd84d763e8..c1ccc909227456a0ff732ebe3a096b551b67fd2e 100644
 3--- a/plugins/frontend-search/README.md
 4+++ b/plugins/frontend-search/README.md
 5@@ -47,6 +47,7 @@ The search content are
 6 * `angularjs <google.com/search?as_q=<search-term>&as_sitesearch=angularjs.org>`
 7 * `reactjs <google.com/search?as_q=<search-term>&as_sitesearch=facebook.github.io/react>`
 8 * `emberjs <emberjs.com>`
 9+* `stackoverflow <stackoverflow.com>`
10 
11 
12 ## Aliases ##
13@@ -72,6 +73,7 @@ There are a few aliases presented as well:
14 * `angularjs` A shorthand for `frontend angularjs`
15 * `reactjs` A shorthand for `frontend reactjs`
16 * `emberjs` A shorthand for `frontend emberjs`
17+* `stackoverflow` A shorthand for `frontend stackoverflow`
18 
19 ## Author
20 
21diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
22index f1d45b0d12e0eafec4a4c876a8b544c76a06fa33..c9e51b2e07dc62986269b7800f5bb53340486631 100644
23--- a/plugins/frontend-search/frontend-search.plugin.zsh
24+++ b/plugins/frontend-search/frontend-search.plugin.zsh
25@@ -17,7 +17,7 @@ function frontend() {
26   fi
27 
28   # check whether the search engine is supported
29-  if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs)' ]];
30+  if [[ ! $1 =~ '(jquery|mdn|compass|html5please|caniuse|aurajs|dartlang|qunit|fontello|bootsnipp|cssflow|codepen|unheap|bem|smacss|angularjs|reactjs|emberjs|stackoverflow)' ]];
31   then
32     echo "Search valid search content $1 not supported."
33     echo "Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
34@@ -40,6 +40,7 @@ function frontend() {
35     echo "* angularjs"
36     echo "* reactjs"
37     echo "* emberjs"
38+    echo "* stackoverflow"
39     echo ""
40 
41     return 1
42@@ -103,6 +104,9 @@ function frontend() {
43     "emberjs")
44       url="${url}emberjs.com"
45       url="${url}/api/#stq=$2&stp=1" ;;
46+    "stackoverflow")
47+      url="${url}https://stackoverflow.com"
48+      url="${url}/search?q=$2" ;;
49     *) echo "INVALID PARAM!"
50        return ;;
51   esac
52@@ -149,3 +153,6 @@ alias smacss='frontend smacss'
53 alias angularjs='frontend angularjs'
54 alias reactjs='frontend reactjs'
55 alias emberjs='frontend emberjs'
56+
57+# search websites
58+alias stackoverflow='frontend stackoverflow'