Skip to content

Commit

Permalink
search: just display all ports available if no query given
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchweaver committed May 17, 2023
1 parent 3570adb commit 8a21f3c
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/ports
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,16 @@ listpkgs() {

# search for a packaged named $1
searchpkg() {
if [ "$1" ] ; then
printf '%s\n' "$PORTS"/*/* | \
while read -r dir ; do
if [ -d "$dir" ] ; then
case $dir in
*"$1"*)
loadpkgfile "${dir##*/}"
printf '%s %s\n' "$name" "$info"
esac
fi
done | sort | column -t -l 2 -o ' '
else
die "No query given"
fi
printf '%s\n' "$PORTS"/*/* | \
while read -r dir ; do
if [ -d "$dir" ] ; then
case $dir in
*"$1"*)
loadpkgfile "${dir##*/}"
printf '%s %s\n' "$name" "$info"
esac
fi
done | sort | column -t -l 2 -o ' '
}

# calculates dependencies of a $name and stores
Expand Down

0 comments on commit 8a21f3c

Please sign in to comment.