Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nurlan
eepm
Commits
865a65ac
Commit
865a65ac
authored
Aug 04, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-search: try to colorize output
parent
5ab18570
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
epm-search
bin/epm-search
+19
-9
No files found.
bin/epm-search
View file @
865a65ac
...
...
@@ -79,14 +79,24 @@ docmd $CMD $string
__epm_search_make_grep
()
{
local
i
shift
[
-z
"
$*
"
]
&&
return
local
list
=
local
listN
=
for
i
in
$@
;
do
local
NOR
=
${
i
/^/
}
if
[
"
$NOR
"
=
"
$i
"
]
;
then
echo
-n
" | grep --
\"
$i
\"
"
else
echo
-n
" | grep -v --
\"
$NOR
\"
"
fi
local
NOR
=
"
${
i
/^/
}
"
[
"
$NOR
"
=
"
$i
"
]
&&
list
=
"
$list
$NOR
"
||
listN
=
"
$listN
$NOR
"
done
#list=$(strip_spaces $list | sed -e "s/ /|/g")
listN
=
$(
strip_spaces
$listN
|
sed
-e
"s/ /|/g"
)
[
-n
"
$listN
"
]
&&
echo
-n
" | egrep -i -v --
\"
$listN
\"
"
# FIXME: The World has not idea how to do grep both string
# http://stackoverflow.com/questions/10110051/grep-with-two-strings-logical-and-in-regex?rq=1
for
i
in
$list
;
do
echo
-n
" | egrep -i --color --
\"
$i
\"
"
done
}
...
...
@@ -94,9 +104,9 @@ __epm_search_make_grep()
epm_search
()
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"
Run search without any string
"
[
-n
"
$pkg_filenames
"
]
||
fatal
"
Please, use search with some argument
"
# FIXME: do it better
local
MGS
=
$(
eval
__epm_search_make_grep
$quoted_args
)
EXTRA_SHOWDOCMD
=
$MGS
EXTRA_SHOWDOCMD
=
"
$MGS
"
eval
"__epm_search_output
\"
$(
eval
get_firstarg
$quoted_args
)
\"
$MGS
"
}
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