Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
0f5d5c7a
Commit
0f5d5c7a
authored
Jun 19, 2017
by
Damian Montero
Committed by
GitHub
Jun 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #755 from uberhacker/improve-crew-search-command
Improve crew search to include the description
parents
7f836d6e
45c01ce8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
crew
crew
+26
-9
No files found.
crew
View file @
0f5d5c7a
...
...
@@ -153,12 +153,24 @@ def search (pkgName, silent = false)
abort
"Package #{pkgName} not found. :("
.
lightred
end
def
regexp_search
(
pkg
_n
ame
)
def
regexp_search
(
pkg
N
ame
)
results
=
Dir
[
"#{CREW_LIB_PATH}packages/*.rb"
]
\
.
select
{
|
f
|
File
.
basename
(
f
,
'.rb'
)
=~
Regexp
.
new
(
pkg
_n
ame
,
true
)
}
\
.
select
{
|
f
|
File
.
basename
(
f
,
'.rb'
)
=~
Regexp
.
new
(
pkg
N
ame
,
true
)
}
\
.
collect
{
|
f
|
File
.
basename
(
f
,
'.rb'
)
}
\
.
each
{
|
f
|
print_package
(
f
,
ARGV
[
2
]
==
"extra"
)
}
abort
"Package not found :("
unless
results
.
length
>
0
if
results
.
empty
?
Find
.
find
(
"#{CREW_LIB_PATH}packages/"
)
do
|
packageName
|
if
File
.
file
?
packageName
package
=
File
.
basename
packageName
,
'.rb'
search
package
,
true
if
(
@
pkg
.
description
=~
/#{
pkgName
}/
i
)
print_package
(
package
,
ARGV
[
2
]
==
"extra"
)
results
.
push
(
package
)
end
end
end
end
abort
"Package #{pkgName} not found. :("
.
lightred
unless
results
.
length
>
0
end
def
help
(
pkgName
)
...
...
@@ -181,12 +193,17 @@ def help (pkgName)
puts
"The [package] must be currently installed."
when
"search"
puts
"Look for a package."
puts
"Usage: crew search [package]"
puts
"If [package] is omitted, all packages will be returned. (i) in front of the name means the package is installed."
puts
"Tips:"
puts
" crew search | grep '(i)' will return all installed packages."
puts
" crew search | grep -v '(i)' will return all available packages not already installed."
puts
" crew search | grep -i 'pattern' will return all packages with 'pattern' in the description."
puts
"Usage: crew search [package] [extra]"
puts
"If [package] is omitted, all packages will be returned."
puts
"(i)"
.
lightgreen
+
" in front of the name means the package is installed."
puts
"The [package] string can also contain regular expressions."
puts
"If the keyword 'extra' is appended, homepage and version will be displayed."
puts
"Examples:"
puts
" crew search | grep '(i)'"
.
lightblue
+
" will display all installed packages."
puts
" crew search | grep -v '(i)'"
.
lightblue
+
" will display all available packages not already installed."
puts
" crew search ^lib"
.
lightblue
+
" will display all packages that start with 'lib'."
puts
" crew search audio"
.
lightblue
+
" will display all packages with 'audio' in the description."
puts
" crew search git extra"
.
lightblue
+
" will display the git package along with homepage and version."
when
"update"
puts
"Update crew."
puts
"Usage: crew update"
...
...
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