zsh: add cogrep function
This commit is contained in:
parent
46d4768f64
commit
b48e734f84
@ -102,6 +102,17 @@ cgrep () {
|
|||||||
find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print0 | xargs -0 grep --color -n "$@"
|
find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print0 | xargs -0 grep --color -n "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Echo NULL separeted file if they exist
|
||||||
|
displayExist(){
|
||||||
|
while IFS= read -r -d '' f; do
|
||||||
|
test -e "$f" && echo -n $f'\0'
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
cogrep () {
|
||||||
|
find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.o' \) -print0 | sed 's/.o\x0/.c\x0/g'| displayExist | xargs -0 grep --color -n "$@"
|
||||||
|
}
|
||||||
|
|
||||||
jgrep () {
|
jgrep () {
|
||||||
find . -name .repo -prune -o -name .git -prune -o -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"
|
find . -name .repo -prune -o -name .git -prune -o -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"
|
||||||
}
|
}
|
||||||
@ -218,7 +229,7 @@ sdocker (){
|
|||||||
img=$(docker ps -a | grep $1 | awk '{print $1}' | head -1);
|
img=$(docker ps -a | grep $1 | awk '{print $1}' | head -1);
|
||||||
if [ -z $img ]; then
|
if [ -z $img ]; then
|
||||||
echo "Running a new container"
|
echo "Running a new container"
|
||||||
docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -v ${AOSP_IMAGE}:/aosp/Project --user="$(id -u):$(id -g)" $1
|
docker run ${AOSP_ARGS} ${=SSH_AUTH_ARGS} -v ${AOSP_IMAGE}:/aosp/Project -v /media/mmaret/data_wd:/aosp/data_wd -v /media/mmaret/data:/aosp/data --user="$(id -u):$(id -g)" $1
|
||||||
else
|
else
|
||||||
echo "Starting $img"
|
echo "Starting $img"
|
||||||
docker start -i -a $img
|
docker start -i -a $img
|
||||||
|
Loading…
Reference in New Issue
Block a user