Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbeeec3

Browse files
committed
For issue transcode-open#49: Change behavior of describe subcommand.
If the results contain exact match, only exact matches are returned. This change is also related to issue transcode-open#33.
1 parent eacd9ee commit cbeeec3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apt-cyg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,15 +2179,15 @@ function apt-cyg-find ()
21792179

21802180
function apt-cyg-describe ()
21812181
{
2182-
local pkg
2182+
local pkg exact
21832183

21842184
checkpackages "$@"
21852185
findworkspace
21862186
getsetup
21872187
for pkg do
2188-
echo ""
2189-
awk -v query="$pkg" -v IGNORECASE="$ignore_case" \
2190-
'BEGIN{RS="\n\n@ "; FS="\n"; ORS="\n"} {if ($1 ~ query) {print $0 "\n"}}' \
2188+
exact="$(grep -q "@ $pkg$" setup.ini&&echo 1||echo "")"
2189+
awk -v query="${exact:+^}$pkg${exact:+$}" -v IGNORECASE="$ignore_case" \
2190+
'BEGIN{RS="\n\n@ "; FS="\n"} ($1 ~ query){print "@ "$0"\n"}' \
21912191
setup.ini
21922192
done
21932193
}

0 commit comments

Comments
 (0)