[2/2] checkupdates: allow filtering the update list

Message ID 20190628201258.20566-2-morganamilo@gmail.com
State Rejected
Headers show
Series
  • [1/2] checkupdates: add -q/--quiet
Related show

Commit Message

morganamilo June 28, 2019, 8:12 p.m. UTC

Comments

Eli Schwartz June 28, 2019, 8:24 p.m. UTC | #1
On 6/28/19 4:12 PM, morganamilo wrote:

What would this be used by? When do people want to only know when there
are *some* updates?

Patch

diff --git a/src/checkupdates.sh.in b/src/checkupdates.sh.in
index 024243c..ae8197c 100644
--- a/src/checkupdates.sh.in
+++ b/src/checkupdates.sh.in
@@ -34,7 +34,7 @@  ${myname} v${myver}
 
 Safely print a list of pending updates
 
-Usage: ${myname} [options]
+Usage: ${myname} [options] [targets...]
 
   Options:
     -d, --download        download pending updates to the pacman cache.
@@ -93,7 +93,7 @@  if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /
 	error 'Cannot fetch updates'
 	exit 1
 fi
-mapfile -t updates < <(pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]')
+mapfile -t updates < <(pacman -Qu --dbpath "$CHECKUPDATES_DB" -- "$@" 2> /dev/null | grep -v '\[.*\]')
 
 if (( ${#updates[@]} )); then
 	if (( $QUIET )); then