Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
ff706f3e
"plugins/git@web.lueluesay.top:root/oh-my-zsh.git" did not exist on "b8ade4815adb42c21bfc8e2b415bde4b295d2c71"
Commit
ff706f3e
authored
Jul 03, 2014
by
willmendesneto
Committed by
Marc Cornellà
Sep 02, 2015
Browse files
Add "help" method in "frontend-search" plugin
parent
f1472f1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/frontend-search/README.md
View file @
ff706f3e
...
@@ -17,9 +17,16 @@ plugins=( <your-plugins-list>... frontend-search)
...
@@ -17,9 +17,16 @@ plugins=( <your-plugins-list>... frontend-search)
## Commands ##
## Commands ##
All command searches are accept only in format
All command searches are accept only in format
s
*
`frontend <search-content> <search-term>`
*
`frontend <search-content> <search-term>`
*
`<search-content> <search-term>`
For more informations, please run help command (are similars)
*
`frontend -h`
*
`frontend --help`
*
`frontend help`
The search content are
The search content are
...
...
plugins/frontend-search/frontend-search.plugin.zsh
View file @
ff706f3e
...
@@ -29,14 +29,36 @@ function frontend() {
...
@@ -29,14 +29,36 @@ function frontend() {
unheap
'http://www.unheap.com/?s='
unheap
'http://www.unheap.com/?s='
)
)
# show help for commands list
if
[[
$1
=
~
'(help|--help|-h)'
]]
then
echo
"Usage:"
echo
"
\n\t
frontend <search-content>
\n\t
<search-content>
\n\t
frontend <search-content> <search-term>"
echo
""
echo
"Where <search-content> is one of:"
echo
"jquery, mdn, compass, html5please, caniuse, aurajs, dartlang, qunit, fontello,"
echo
"bootsnipp, cssflow, codepen, unheap, bem, smacss, angularjs, reactjs, emberjs"
echo
"help"
echo
""
echo
"Where <search-term> is a term to search in allowed repositories"
echo
""
echo
"frontend --help show plugin help"
echo
"frontend -h show plugin help"
echo
""
echo
"It is allowed to directly access all search contents."
echo
""
return
1
fi
# no keyword provided, simply show how call methods
# no keyword provided, simply show how call methods
if
[[
$#
-le
1
]]
;
then
if
[[
$#
-le
1
]]
then
echo
"Please provide a search-content and a search-term for app.
\n
Ex:
\n
frontend <search-content> <search-term>
\n
"
echo
"Please provide a search-content and a search-term for app.
\n
Ex:
\n
frontend <search-content> <search-term>
\n
"
return
1
return
1
fi
fi
# check whether the search engine is supported
# check whether the search engine is supported
if
[[
-z
"
$urls
[
$1
]"
]]
;
then
if
[[
-z
"
$urls
[
$1
]"
]]
then
then
echo
"Search valid search content
$1
not supported."
echo
"Search valid search content
$1
not supported."
echo
"Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
echo
"Valid contents: (formats 'frontend <search-content>' or '<search-content>')"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment