We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32dde37 commit 407e7deCopy full SHA for 407e7de
kgrep
@@ -13,6 +13,7 @@ _grep=grep
13
_setx=:
14
grep_opt=
15
git_fp=
16
+match=
17
for opt do
18
shift
19
case "$opt" in
@@ -24,6 +25,7 @@ for opt do
24
25
--first-parent) git_fp=$opt ;;
26
-x | --extra) all=y ;;
27
-a | --alt) alt=y ;;
28
+ --match=*) match=${opt#*=} ;;
29
-*) echo >&2 "unknown option: $opt"; exit 1 ;;
30
*) set -- "$@" "$opt";;
31
esac
@@ -37,6 +39,7 @@ cd ~/linux
37
39
while read -r root br dir; do
38
40
[[ "$root" =~ ^[[:space:]]*\# ]] && continue
41
[[ "$root" =~ ^\? ]] && [ ! -v all ] && continue
42
+ [[ "$root $br $dir" =~ $match ]] || continue
43
root=${root#\?}
44
cd ~/linux/"$root"
45
if [ "${br:-@}" = '@' ]; then
0 commit comments