diff options
author | Landry Breuil <landry@cvs.openbsd.org> | 2009-09-07 20:39:56 +0000 |
---|---|---|
committer | Landry Breuil <landry@cvs.openbsd.org> | 2009-09-07 20:39:56 +0000 |
commit | 211fbc439442169315739837a03a8a12528f1b10 (patch) | |
tree | 84fe7d9c1e3ebb73f18d64eb5d4d18f85bcee9e5 | |
parent | b1238b4e623f7a04e037e294a19f91d013b79074 (diff) |
Don't print package comment when -q is given, and no other option is
used. This way, pkg_info -q only shows installed pkgnames.. and can
replace `ls /var/db/pkg` in scripts.
ok espie@
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index 04f3aba03ad..b236f90a52c 100644 --- a/usr.sbin/pkg_add/pkg_info +++ b/usr.sbin/pkg_add/pkg_info @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_info,v 1.73 2009/04/19 14:58:32 espie Exp $ +# $OpenBSD: pkg_info,v 1.74 2009/09/07 20:39:55 landry Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -252,7 +252,9 @@ sub print_info if ($opt_I) { my $l = 20 - length($pkg); $l = 1 if $l <= 0; - print $pkg, " "x$l, get_comment($handle->info), "\n"; + print $pkg; + print " "x$l, get_comment($handle->info) unless $opt_q; + print "\n"; } else { my $done = 0; if ($opt_c) { |